You solution should be just fine because nothing in Unix is really prepared
to handle dates from before 1 Jan 1970 00:00:00 GMT. In fact, I have also
encountered programs that failed to work when file dates were set to 0,
because they internally used 0 as some kind of magic value. In effect, the
first usable Unix time_t value is 1 Jan 1970 00:00:01 GMT.
Oh, and by the way, you shouldn't really say that a Unix/POSIX time_t value
is the "number of seconds since 00:00:00 UTC, 1/1/1970". Due to the
insertion of occasional leap seconds into the UTC timescale on various
occasions since 1972, you need a table of leap seconds in order to actually
compute the number of true (atomic clock) seconds since that moment.
In fact the Unix/POSIX time_t representation for time can't really be said
to represent UTC time at all, since it lacks a way to represent such
legitimate UTC times as "31 Dec 1990 23:59:60 UTC".
|