From: Mike C. <MF...@uk...> - 2008-01-14 16:08:32
|
This seems to work on both Windows & Linux: now=time(NULL); /* record now */ /* If indeed working with GMT, calculate GMT offset */ ts=gmtime(&now); /* If we convert time back using [local] MKTIME, we will get -GMT_offset */ /* applied, and from that we can trivially calculate the true GMT_offset */ gmtoffset=now-mktime(ts); mfc Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |