[PLUG] Final comment on timezone conversions
website reader
website.reader3 at gmail.com
Thu Nov 21 20:31:19 UTC 2013
I successfully fixed my timezone conversions by staying inside the
invariant, which is the localtime_r(time_t) call and its inverse function
mktime(tm) and carefully skewing the Unix epoch seconds depending upon the
timezone settings and making slight adjustments to the tm struct objects
when finished.
What is really needed are the following two POSIX threadsafe functions,
each is an inverse of the other
epoch_to_tm(time_t, timezone)
tm_to_epoch(tm)
and both will have to use the timezone data files to make the conversions
properly, depending upon the actual timezone and whether or not daylight
savings time is in effect.
This whole thinig gets meesy, due to the legislated timezones and whether
or not daylight savings time is observed in a zone.
But having two functions, each an inverse, will greatly simiply timezone
conversions and avoid depending upon a global variable to do the conversion.
More information about the PLUG
mailing list