Re: BUG: date 7.1 - reading date string

2010-02-05 Thread Klaus Bramstedt

Dear Sven, Bob, Philip,

thank a lot for your hints! The daylight saving time (DST) is indeed the 
problem, so I have to use the '-u' option of date for proper working of my 
script.
Sorry for bothering, I should have thought myself about this. Maybe an 
additional hint in the error message to the DST problem would help other 
users (like (DST gap))?


thanks again

Klaus


On Thu, 4 Feb 2010, Sven Joachim wrote:

Am 04.02.2010 um 14:45 schrieb Klaus Bramstedt:


I used the command
 date -d $DATE
for almost all dates between Aug 2002 end Jan 2010 in a script.
Date has a format like this
   2003-03-30 02:08:17
However, 7 of 42048 randomly distributed dates in the list failed:

date: ungültiges Datum „2003-03-30 02:08:17“
date: ungültiges Datum „2003-03-30 02:25:58“
date: ungültiges Datum „2005-03-27 02:08:41“
date: ungültiges Datum „2006-03-26 02:41:44“
date: ungültiges Datum „2008-03-30 02:08:09“
date: ungültiges Datum „2009-03-29 02:09:26“
date: ungültiges Datum „2007-03-25 02:03:47“

For me, this seems to be a bug in the date reading part. The critical
combination seems to be end of March and '02' as hour.


Yes, it's the non-existent hour during DST adjustment on the last Sunday
in March.  These dates are indeed invalid in the German timezone.

Sven


BUG: date 7.1 - reading date string

2010-02-04 Thread Klaus Bramstedt

Dear coreutils-team,

I used the command
 date -d $DATE
for almost all dates between Aug 2002 end Jan 2010 in a script.
Date has a format like this
   2003-03-30 02:08:17
However, 7 of 42048 randomly distributed dates in the list failed:

date: ungültiges Datum „2003-03-30 02:08:17“
date: ungültiges Datum „2003-03-30 02:25:58“
date: ungültiges Datum „2005-03-27 02:08:41“
date: ungültiges Datum „2006-03-26 02:41:44“
date: ungültiges Datum „2008-03-30 02:08:09“
date: ungültiges Datum „2009-03-29 02:09:26“
date: ungültiges Datum „2007-03-25 02:03:47“

For me, this seems to be a bug in the date reading part. The critical 
combination seems to be end of March and '02' as hour.


My setup:

uname -a
Linux  2.6.31.8-0.1-desktop #1 SMP PREEMPT 2009-12-15 23:55:40 +0100 
x86_64 x86_64 x86_64 GNU/Linux

--- (LANG=C gives the same errore)
echo $LANG
de_DE.UTF-8
---
date --version
date (GNU coreutils) 7.1
Copyright © 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html.

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


No need for an direkt answer, this is not critical for me.

best regards

Klaus Bramstedt


__
Dr. Klaus Bramstedt   Tel.  +49/421/218-62084
   ^^^
Institute of Environmental Physics (IUP)/ Fax   +49/421/218-4555
   Institute of Remote Sensing (ife)
University of Bremen, NW1
Otto-Hahn-Allee 1
D-28359 Bremen, Germany
E-mail: klaus.bramst...@iup.physik.uni-bremen.de
   WWW: http://www.iup.uni-bremen.de
__



Re: BUG: date 7.1 - reading date string

2010-02-04 Thread Sven Joachim
Am 04.02.2010 um 14:45 schrieb Klaus Bramstedt:

 I used the command
  date -d $DATE
 for almost all dates between Aug 2002 end Jan 2010 in a script.
 Date has a format like this
2003-03-30 02:08:17
 However, 7 of 42048 randomly distributed dates in the list failed:

 date: ungültiges Datum „2003-03-30 02:08:17“
 date: ungültiges Datum „2003-03-30 02:25:58“
 date: ungültiges Datum „2005-03-27 02:08:41“
 date: ungültiges Datum „2006-03-26 02:41:44“
 date: ungültiges Datum „2008-03-30 02:08:09“
 date: ungültiges Datum „2009-03-29 02:09:26“
 date: ungültiges Datum „2007-03-25 02:03:47“

 For me, this seems to be a bug in the date reading part. The critical
 combination seems to be end of March and '02' as hour.

Yes, it's the non-existent hour during DST adjustment on the last Sunday
in March.  These dates are indeed invalid in the German timezone.

Sven




Re: BUG: date 7.1 - reading date string

2010-02-04 Thread Philip Rowlands

On Thu, 4 Feb 2010, Klaus Bramstedt wrote:


I used the command
date -d $DATE
for almost all dates between Aug 2002 end Jan 2010 in a script.
Date has a format like this
  2003-03-30 02:08:17
However, 7 of 42048 randomly distributed dates in the list failed:

date: ungültiges Datum „2003-03-30 02:08:17“
date: ungültiges Datum „2003-03-30 02:25:58“
date: ungültiges Datum „2005-03-27 02:08:41“
date: ungültiges Datum „2006-03-26 02:41:44“
date: ungültiges Datum „2008-03-30 02:08:09“
date: ungültiges Datum „2009-03-29 02:09:26“
date: ungültiges Datum „2007-03-25 02:03:47“

For me, this seems to be a bug in the date reading part. The critical 
combination seems to be end of March and '02' as hour.


You don't say which timezone you're using, but I'll guess Europe/Berlin, 
in which case this is a DST issue, but not a bug.


$ zdump -v Europe/Berlin  | grep 2003
Europe/Berlin  Sun Mar 30 00:59:59 2003 UTC = Sun Mar 30 01:59:59 2003 CET 
isdst=0 gmtoff=3600
Europe/Berlin  Sun Mar 30 01:00:00 2003 UTC = Sun Mar 30 03:00:00 2003 CEST 
isdst=1 gmtoff=7200
Europe/Berlin  Sun Oct 26 00:59:59 2003 UTC = Sun Oct 26 02:59:59 2003 CEST 
isdst=1 gmtoff=7200
Europe/Berlin  Sun Oct 26 01:00:00 2003 UTC = Sun Oct 26 02:00:00 2003 CET 
isdst=0 gmtoff=3600

According to the daylight saving rules there was a discontinuity from 
01:59:59 - 03:00:00 on the dates you gave above, at the start of DST.


Please see this entry in the coreutils FAQ:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e


Cheers,
Phil




Re: BUG: date 7.1 - reading date string

2010-02-04 Thread Bob Proulx
Klaus Bramstedt wrote:
 I used the command
  date -d $DATE
 for almost all dates between Aug 2002 end Jan 2010 in a script.
 Date has a format like this
2003-03-30 02:08:17
 However, 7 of 42048 randomly distributed dates in the list failed:

 date: ungültiges Datum „2003-03-30 02:08:17“
 date: ungültiges Datum „2003-03-30 02:25:58“
 date: ungültiges Datum „2005-03-27 02:08:41“
 date: ungültiges Datum „2006-03-26 02:41:44“
 date: ungültiges Datum „2008-03-30 02:08:09“
 date: ungültiges Datum „2009-03-29 02:09:26“
 date: ungültiges Datum „2007-03-25 02:03:47“

 For me, this seems to be a bug in the date reading part. The critical  
 combination seems to be end of March and '02' as hour.

Those timestamps do not exist because your local daylight savings time
skipped over that hour.  Those times never existed in your timezone.
You didn't say what timezone you were using but for discussion I will
assume one.

  $ zdump -v Europe/Berlin | grep 2009
  Europe/Berlin  Sun Mar 29 00:59:59 2009 UTC = Sun Mar 29 01:59:59 2009 CET 
isdst=0 gmtoff=3600
  Europe/Berlin  Sun Mar 29 01:00:00 2009 UTC = Sun Mar 29 03:00:00 2009 CEST 
isdst=1 gmtoff=7200

As you can see there was no 2 hour then.  It skipped from 01:59:59 to
03:00:00.

Please see this reference for more information:

  
http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e

Bob