How do I do the above? There is mktime function but that treats the input as expressed in local time but how do i perform the conversion if my input tm variable happens to be in UTC.
Good answer - only demerit is that it is a non-standard (as in, not in POSIX or C standard) function.
Jonathan Leffler
2008-11-12 22:09:14
I've seen other answers on the net that talk about getting the timezone offset using something like (note this is pseudo code - the parameters aren't right): difftime( mktime( gmtime( time())), mktime( localtime( time()))). But no one ever says how you apply this offset to your time_t variable.
Michael Burr
2008-11-13 00:09:54
Does this work in windows too?
2008-11-13 00:18:11