Today I noticed that relative dates of the form 'last [day-of-week]' are
going back in time an extra day. This seems to effect multiple versions
of GNU date. Observe:

$ date --version
date (GNU sh-utils) 1.16

$ date
Mon Apr  2 11:19:34 PDT 2001

$ date -d 'last Sunday' 
Sat Mar 31 23:00:00 PST 2001

$ builds/sh-utils/sh-utils-2.0/src/date --version
date (GNU sh-utils) 2.0
Written by David MacKenzie.

Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ builds/sh-utils/sh-utils-2.0/src/date          
Mon Apr  2 11:20:17 PDT 2001

$ builds/sh-utils/sh-utils-2.0/src/date -d 'last Sunday'
Sat Mar 31 23:00:00 PST 2001


I use this construct frequently from shell scripts and can say with
great certainty that last Monday 'date -d "last Sunday"' was working
correctly. Could this be related to the timezone change somehow?
Particularly since the date has the time 23:00:00? (Normally my shell
scripts use a format string that does not include the time.)

Benjamin

_______________________________________________
Bug-sh-utils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-sh-utils

Reply via email to