bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug report for "date"


From: Bob Proulx
Subject: Re: Bug report for "date"
Date: Tue, 28 Jul 2009 17:07:55 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

Paul Grinberg wrote:
> Gives me correct date:
> [ctpsmg11-dcdhealth@/opt/app/dcdhealth] # TZ=EDT+150 date
> Wed Jul 22 12:27:15 EDT 2009
> 
> Gives me incorrect date:
> [ctpsmg11-dcdhealth@/opt/app/dcdhealth] # TZ=EDT+172 date
> Tue Jul 28 18:27:09 GMT 2009
> 
> Basically I cannot go back more than 6 days...

You have specified an invalid timezone.  Timezones are only defined
from 0 through 23 hours 59 seconds which is sufficient to define all
existing timezones.  Please see the GNU C manual for a complete
specification of the timezone using the TZ variable.

  http://www.gnu.org/software/coreutils/manual/libc.html#TZ-Variable

  The offset specifies the time value you must add to the local time
  to get a Coordinated Universal Time value.  It has syntax like
  [+|-]hh[:mm[:ss]].  This is positive if the local time zone is west
  of the Prime Meridian and negative if it is east.  The hour must be
  between 0 and 23, and the minute and seconds between 0 and 59.

If you are trying to do math calculations using date then it is better
to use date's relative time feature.

  $ date -R --date="-14 days"
  Tue, 14 Jul 2009 17:04:43 -0600

Bob




reply via email to

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