G
Grey Alien
I need to convert timestamps that are given as the number of seconds
that have elapsed since midnight UTC of January 1, 1970, (not counting
leap seconds).
It seems all of the std C functions expect positive offsets from this
date and are incapable of working on dates preceeding the epoch (i.e.
negative offsets) - which IMHO shows a remarkable lack of foresight -
and is *just* a little bit annoying.
Does anyone know of an algo I can use to calculate the components to
fill a variable of type 'struct tm' - given a time_t variable with a -ve
offset from the UNIX epoch?
Or to reword teh above, does anyone know how I can extract the century,
year, month, day, hour, min, second from a time_t value that represents
a timestamp BEFORE midnight UTC of January 1, 1970?
that have elapsed since midnight UTC of January 1, 1970, (not counting
leap seconds).
It seems all of the std C functions expect positive offsets from this
date and are incapable of working on dates preceeding the epoch (i.e.
negative offsets) - which IMHO shows a remarkable lack of foresight -
and is *just* a little bit annoying.
Does anyone know of an algo I can use to calculate the components to
fill a variable of type 'struct tm' - given a time_t variable with a -ve
offset from the UNIX epoch?
Or to reword teh above, does anyone know how I can extract the century,
year, month, day, hour, min, second from a time_t value that represents
a timestamp BEFORE midnight UTC of January 1, 1970?