Dumb questions about GMT offset in tm structure

Mark Horton seismo!cbpavo.MIS.OH.ATT.COM!mark
Wed Mar 18 22:20:31 UTC 1987


> > Sometimes we care about things that happened in the 19th century
> > (birthdates, for example.)
> 
> Yes, but nothing in a UNIX system happened in the 19th century.
> Non-UNIX systems lacking "time_t" have done quite well dealing with
> times; I don't see any need to use "time_t" for every kind of
> timestamp any application could possibly want.

Sorry, but I disagree.  UNIX provides some very nice date/time
manipulation routines, which know about time zones and daylight
time, months of the year, leap years, and various other ugly
stuff that people don't like to reimplement.  An application that
has to store a date has a strong incentive to use the existing
routines rather than to invent a new format.  It would be VERY NICE
if the UNIX routines were useful for more than just timestamps on
the local system.

It is not necessary that time_t be used for this, as long as there
is some standard representation that can do it.  ctime might be
one, ISO time might be one, or struct tm might be one, or it might
be something new.

I had to reinvent this wheel, and I swiped code from ctime like crazy.
I wound up choosing ISO time (char string) as my standard format.
My resulting code is highly unportable, because it knows about time_t
and two different conventions for time zone, and it has all the daylight
rules built into it.

	Mark



More information about the tz mailing list