delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
MIME-Version: | 1.0 |
Subject: | date function: how many days in october are there? |
Date: | Thu, 29 Sep 2005 21:41:03 -0600 |
Message-ID: | <3C46C4ED0F9B944690547357EB7F1C0FF430@COFORTCOL2S304.agwest.one.usda.gov> |
From: | "Pagano, Tom - Portland, OR" <tom DOT pagano AT por DOT usda DOT gov> |
To: | <cygwin AT cygwin DOT com> |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id j8U3f7Ud024810 |
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?) When I run date -d "$i-10-01 +1 month -1 day" I get Tue Oct 31 00:00:00 PST 1950 Wed Oct 31 00:00:00 PST 1951 Fri Oct 31 00:00:00 PST 1952 Sat Oct 31 00:00:00 PST 1953 Sun Oct 31 00:00:00 PST 1954 Mon Oct 31 00:00:00 PST 1955 Wed Oct 31 00:00:00 PST 1956 Thu Oct 31 00:00:00 PST 1957 Fri Oct 31 00:00:00 PST 1958 Sat Oct 31 00:00:00 PST 1959 Mon Oct 31 00:00:00 PST 1960 Tue Oct 31 00:00:00 PST 1961 Wed Oct 31 00:00:00 PST 1962 Thu Oct 31 00:00:00 PST 1963 Sat Oct 31 00:00:00 PST 1964 Sun Oct 31 00:00:00 PST 1965 Mon Oct 31 00:00:00 PST 1966 Tue Oct 31 00:00:00 PST 1967 Thu Oct 31 00:00:00 PST 1968 Fri Oct 31 00:00:00 PST 1969 Fri Oct 30 23:00:00 PST 1970 Sun Oct 31 00:00:00 PDT 1971 Mon Oct 30 23:00:00 PST 1972 Tue Oct 30 23:00:00 PST 1973 Wed Oct 30 23:00:00 PST 1974 Thu Oct 30 23:00:00 PST 1975 Sun Oct 31 00:00:00 PDT 1976 Sun Oct 30 23:00:00 PST 1977 Tue Oct 30 23:00:00 PST 1979 Thu Oct 30 23:00:00 PST 1980 Fri Oct 30 23:00:00 PST 1981 Sun Oct 31 00:00:00 PDT 1982 Sun Oct 30 23:00:00 PST 1983 Tue Oct 30 23:00:00 PST 1984 Wed Oct 30 23:00:00 PST 1985 Thu Oct 30 23:00:00 PST 1986 Fri Oct 30 23:00:00 PST 1987 Sun Oct 30 23:00:00 PST 1988 Mon Oct 30 23:00:00 PST 1989 Tue Oct 30 23:00:00 PST 1990 Wed Oct 30 23:00:00 PST 1991 Fri Oct 30 23:00:00 PST 1992 Sun Oct 31 00:00:00 PDT 1993 Sun Oct 30 23:00:00 PST 1994 Mon Oct 30 23:00:00 PST 1995 Wed Oct 30 23:00:00 PST 1996 Thu Oct 30 23:00:00 PST 1997 Fri Oct 30 23:00:00 PST 1998 Sun Oct 31 00:00:00 PDT 1999 Mon Oct 30 23:00:00 PST 2000 Tue Oct 30 23:00:00 PST 2001 Wed Oct 30 23:00:00 PST 2002 Thu Oct 30 23:00:00 PST 2003 Sun Oct 31 00:00:00 PDT 2004 Sun Oct 30 23:00:00 PST 2005 Mon Oct 30 23:00:00 PST 2006 Tue Oct 30 23:00:00 PST 2007 Thu Oct 30 23:00:00 PST 2008 Fri Oct 30 23:00:00 PST 2009 Sun Oct 31 00:00:00 PDT 2010 Sun Oct 30 23:00:00 PST 2011 Tue Oct 30 23:00:00 PST 2012 Wed Oct 30 23:00:00 PST 2013 Thu Oct 30 23:00:00 PST 2014 Fri Oct 30 23:00:00 PST 2015 as opposed to date -d "$i-11-01 -1 day" Tue Oct 31 00:00:00 PST 1950 Wed Oct 31 00:00:00 PST 1951 Fri Oct 31 00:00:00 PST 1952 Sat Oct 31 00:00:00 PST 1953 Sun Oct 31 00:00:00 PST 1954 Mon Oct 31 00:00:00 PST 1955 Wed Oct 31 00:00:00 PST 1956 Thu Oct 31 00:00:00 PST 1957 Fri Oct 31 00:00:00 PST 1958 Sat Oct 31 00:00:00 PST 1959 Mon Oct 31 00:00:00 PST 1960 Tue Oct 31 00:00:00 PST 1961 Wed Oct 31 00:00:00 PST 1962 Thu Oct 31 00:00:00 PST 1963 Sat Oct 31 00:00:00 PST 1964 Sun Oct 31 00:00:00 PST 1965 Mon Oct 31 00:00:00 PST 1966 Tue Oct 31 00:00:00 PST 1967 Thu Oct 31 00:00:00 PST 1968 Fri Oct 31 00:00:00 PST 1969 Sat Oct 31 00:00:00 PST 1970 Sun Oct 31 01:00:00 PDT 1971 Tue Oct 31 00:00:00 PST 1972 Wed Oct 31 00:00:00 PST 1973 Thu Oct 31 00:00:00 PST 1974 Fri Oct 31 00:00:00 PST 1975 Sun Oct 31 01:00:00 PDT 1976 Mon Oct 31 00:00:00 PST 1977 Wed Oct 31 00:00:00 PST 1979 Fri Oct 31 00:00:00 PST 1980 Sat Oct 31 00:00:00 PST 1981 Sun Oct 31 01:00:00 PDT 1982 Mon Oct 31 00:00:00 PST 1983 Wed Oct 31 00:00:00 PST 1984 Thu Oct 31 00:00:00 PST 1985 Fri Oct 31 00:00:00 PST 1986 Sat Oct 31 00:00:00 PST 1987 Mon Oct 31 00:00:00 PST 1988 Tue Oct 31 00:00:00 PST 1989 Wed Oct 31 00:00:00 PST 1990 Thu Oct 31 00:00:00 PST 1991 Sat Oct 31 00:00:00 PST 1992 Sun Oct 31 01:00:00 PDT 1993 Mon Oct 31 00:00:00 PST 1994 Tue Oct 31 00:00:00 PST 1995 Thu Oct 31 00:00:00 PST 1996 Fri Oct 31 00:00:00 PST 1997 Sat Oct 31 00:00:00 PST 1998 Sun Oct 31 01:00:00 PDT 1999 Tue Oct 31 00:00:00 PST 2000 Wed Oct 31 00:00:00 PST 2001 Thu Oct 31 00:00:00 PST 2002 Fri Oct 31 00:00:00 PST 2003 Sun Oct 31 01:00:00 PDT 2004 Mon Oct 31 00:00:00 PST 2005 Tue Oct 31 00:00:00 PST 2006 Wed Oct 31 00:00:00 PST 2007 Fri Oct 31 00:00:00 PST 2008 Sat Oct 31 00:00:00 PST 2009 Sun Oct 31 01:00:00 PDT 2010 Mon Oct 31 00:00:00 PST 2011 Wed Oct 31 00:00:00 PST 2012 Thu Oct 31 00:00:00 PST 2013 Fri Oct 31 00:00:00 PST 2014 Sat Oct 31 00:00:00 PST 2015
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |