time.h design issues
D. J. Bernstein
djb at cr.yp.to
Sun Aug 29 01:46:04 UTC 1999
Paul Hill writes:
> BTW, is there some description of your API on the WWW somewhere?
The code is freely available from http://pobox.com/~djb/libtai.html.
I've started putting up API pages for the next release; in particular,
http://pobox.com/~djb/libtai/caldate.html is done.
> An alternative API _might_ provide a set of fields
> (again like tm in Markus' and Paul E's API)
> that could include day of week and week of month and then be
> willing to figure the MJD from whatever is provided.
Who cares? Remember that the point of libtai is to support real
programs, not to build an API in the sky.
> I would also hope that that any header file would define
> SUNDAY, MONDAY, TUESDAY etc. so I don't have to know
> the convention, even if there is an ISO standard.
Why would a program want to refer to specific weekdays, rather than
having a table of all the weekdays?
> I hope that is with or without consideration for local TZ.
What are you talking about? The Gregorian calendar does not depend on
your local time zone.
> I'm underwhelmed by the need when using your API to put
> together and take apart a MJD and all fields, once for each day
> just to walk back to a nearby weekday.
This need is a figment of your imagination. The reason I wrote ``there
are faster ways to do this, of course'' was to forestall this pointless
More information about the tz