Re: getdate.y question

Paul Eggert <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs
Message-ID <[email protected]>
Derek Robert Price <[email protected]> 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  <[email protected]>

	* 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.