I see, so the issue is whether "1 day" is defined as 24 hours or the same 
hour/minute/second on the previous day. 
 
And this would apply to things on the front end of the season like 
 
$ date -d "2001-04-01 -1 day"
Sat Mar 31 00:00:00 PST 2001
$ date -d "2001-04-02 -2 day"
Fri Mar 30 23:00:00 PST 2001
 
as well. My workaround since I don't need the hours (just the year, month, day) 
might be to set the time to noon instead of midnight. 
 
$ date -d "12:00:00 2001-04-01 -1 day"
Sat Mar 31 11:00:00 PST 2001
$ date -d "12:00:00 2001-04-02 -2 day"
Sat Mar 31 11:00:00 PST 2001
 
Good info, lightning response, thanks. 
 
Tom
 

        -----Original Message----- 
        From: Eric Blake [mailto:[EMAIL PROTECTED] 
        Sent: Thu 9/29/2005 9:49 PM 
        To: Pagano, Tom - Portland, OR 
        Cc: cygwin@cygwin.com 
        Subject: Re: date function: how many days in october are there?
        
        

        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1
        
        According to Pagano, Tom - Portland, OR on 9/29/2005 9:41 PM:
        > I've noticed that the date function does something strange trying to 
access October 31st in a statement like
        > 
        > $ date -d "1970-10-01 +1 month -1 day"
        > as opposed to something like
        > $ date -d "1970-11-01 -1 day"
        > which (I think??) should be functionally equivalent. The actual 
results of the 2nd are obviously preferrable to the 1st... but I do note 
something squirrly going on with the hours in both (daylight savings time?)
        
        Indeed it is daylight savings.  date has no cygwin-specific patches, but
        the brand new coreutils 5.90 has been released upstream that has some
        patches in date parsing.  Once I can get that packaged, you may want to
        rerun your tests - if the bug is still present at that time, then report
        it upstream.
        
        - --
        Life is short - so eat dessert first!
        
        Eric Blake             [EMAIL PROTECTED]
        volunteer cygwin coreutils maintainer
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.1 (Cygwin)
        Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
        Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
        
        iD8DBQFDPLW084KuGfSFAYARAso1AJ4ia3ivMy0zj2hSJFqHJp6wK3ZwSgCg0wKD
        2rBt20yYxwrSG1sxLaqbTHU=
        =0bxZ
        -----END PGP SIGNATURE-----
        

Reply via email to