bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

date 2.0: BUG OR FEATURE?


From: Wolfgang Reimer
Subject: date 2.0: BUG OR FEATURE?
Date: Thu, 11 Oct 2001 00:26:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1

BUG OR FEATURE?

IMHO, when specifying a date via --date="<date> + <offset>" and if <date> is before "Sun Mar 31 03:00:00 UTC 1996" and "<date> + <offset>" is after "Sun Mar 31 01:59:59 UTC 1996" then the time shown by "date" is incorrect (by one hour):

  address@hidden reimer]$ date -u -d '1996-03-31 01:59:59 UTC 1 sec'
  Sun Mar 31 03:00:00 UTC 1996

The following is o.k. ("<date> + <offset>" is before "Sun Mar 31 02:00:00 UTC 1996"):

  address@hidden reimer]$ date -u -d '1996-03-31 01:59:59 UTC 0 sec'
  Sun Mar 31 01:59:59 UTC 1996


I noticed this behavior when trying to convert unix time to a date string via "date" as documented in sh-utils.info (below I expect "Sun Mar 31 02:00:00 UTC 1996" as result):

  address@hidden reimer]$ date -u -d '1970-01-01 UTC 828237600 sec'
  Sun Mar 31 03:00:00 UTC 1996

  address@hidden reimer]$ date -d '1970-01-01 UTC 828237600 sec' +%s
  828241200

The following is o.k. ("<date> + <offset>" is before "Sun Mar 31 02:00:00 UTC 1996"):

  address@hidden reimer]$ date -u -d '1970-01-01 UTC 828237599 sec'
  Sun Mar 31 01:59:59 UTC 1996

  address@hidden reimer]$ date -d '1970-01-01 UTC 828237599 sec' +%s
  828237599

******************* INFORMATION ***********************

"date" is from "sh-utils-2.0-13.i386.rpm" for RedHat Linux 7.1 (ix86).

"date" version:

  address@hidden reimer]$ 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.

My machine architecture:

  address@hidden reimer]$ uname -s -r -v -m
  Linux 2.4.3-12smp #1 SMP Fri Jun 8 14:38:50 EDT 2001 i686


Regards,

Wolfgang.
--
Wolfgang Reimer (Dr.-Ing.)    Senior Software Developer

V P I   S y s t e m s   I n g e n i e u r g e s . m b H
phone : +49 30 398058-24      fax :    +49 30 398058-58
mailto:address@hidden      http://www.VPIsystems.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]