[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bug report for "date"
From: |
Paul Grinberg |
Subject: |
RE: Bug report for "date" |
Date: |
Tue, 28 Jul 2009 19:24:54 -0400 |
Bob,
Thank you for your reply. You are right, I am trying to calculate time
backwards....it only allows 6 days back...i need 7 :) the whole week :)
Unfortunately in solaris it does not work :(((
# date -R --date="-14 days"
date: illegal option -- R
date: illegal option -- date=-14 days
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
Thanks,
Paul
-----Original Message-----
From: Bob Proulx [mailto:address@hidden
Sent: Tuesday, July 28, 2009 7:08 PM
To: Paul Grinberg
Cc: address@hidden
Subject: Re: Bug report for "date"
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