Definitions of date arithmetic

D. J. Bernstein djb at
Sun Oct 11 01:32:39 UTC 1998

Paul Eggert writes:
> The same as 1 month before 31 March.

Okay. You can easily implement that on top of something like mktime():

   void month_add(struct caldate *out,struct caldate *in,int m)
     *out = *in;
     out->month += m;

     if (out->day != in->day) {
       out->day = FIRST - 1;

This example certainly doesn't convince me that mktime()'s handling of
invalid dates is a bad thing.

1000 recipients, 28.8 modem, 10 seconds.

More information about the tz mailing list