[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] getdate.y question

From: Paul Eggert
Subject: Re: [Bug-gnulib] getdate.y question
Date: Wed, 28 Apr 2004 23:51:31 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Derek Robert Price <derek@ximbiot.com> writes:

> the current getdate.y fails to reject dates where the day of the month
> is out of range for the specified month.  It simply assumes that any
> overflow should step into the next month....
> Can anyone tell me the rationale for this change?

That's a consequence of the following patch to sh-utils:

1997-01-06  Paul Eggert  <eggert@twinsun.com>

        * getdate.y: Rewrite to use mktime.

The previous code converted broken-down dates to internal times
incorrectly in some cases, and it was easier just to use mktime to fix
this.  mktime interprets overflow to mean "go to the next month".

I hope nobody is relying on getdate's current mktime-like behavior.
On the other hand, fixing getdate to reject invalid dates like "Apr
31" would be a bit of work, due to some tricky interactions between
mktime, overflow checking, and time zones.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]