> > If you take any other month than October, it is working fine. So
> > 09-01-2000 + 1 month => 10-01-2000.
> regression=# select ('10-01-2000'::timestamp + ('1 month')::timespan);
>         ?column?
> ------------------------
>  2000-10-31 23:00:00-05
> (1 row)
> Thomas, isn't the addition of '1 month' done symbolically in a struct tm?
> I suspect you may have forgotten to set tm_isdst = -1 before invoking
> mktime(), causing it to interpret the time of day on the target date
> as the same DST or not-DST case that applied on the initial date.
> Seems to me that both times should be taken as "local time", so you
> should force mktime() to recompute whether DST is in effect or not.

That particular operation needs mktime() called twice in some cases :( 

Once for the input timestamp and once for the intermediate result. I'm
testing a fix now which gives the right result for this particular case.

                   - Tom

Reply via email to