Re: tomorrows date

From: Green, Simon (Simon.Green@EU.ALTRIA.COM)
Date: Thu Dec 11 2003 - 06:08:06 EST


You have to base it on your existing TZ.
So from "CST6CDT" you'd go to "CST-18CDT". (6 - 24 to go forward one day.)
If you normally specify daylight saving time information, you should include
that too. If you normally rely on the defaults you'll be OK.
Leap years are taken into account automatically.

The maximum forward (negative) offset is a shade under 300,000, which takes
you to 2038 at the moment. The maximum backwards (positive) offset is
somewhat greater, so you can look back to 1912.

I have seen mention of a limit to the offset in some AIX documentation, but
in practice you can ignore it. There is a very small risk that large TZ
offsets won't work in some future release, but it doesn't seem likely that
that particular piece of code is going to be re-written since it works just
fine.

Simon Green
Altria ITSC Europe Ltd

AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html

AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.

> -----Original Message-----
> From: Shawn Bierman [mailto:BiermanS@METHODISTHEALTH.ORG]
> Sent: 10 December 2003 14:53
> To: aix-l@Princeton.EDU
> Subject: Re: tomorrows date
>
>
> What are you saying? I do not need yesterdays date. Only
> tomorrow's. I did have the time zone wrong, its actually
> CST. But does that allow for daylight savings and leap years etc?
>
> ksh TZ=CST-24 date +%m%d%y
>
> -shawn
>
>
> >>> rick.renison@EDS.COM 12/9/03 9:13:25 PM >>>
> It doesn't always give yestday's date.
> eg. TZ=XXX-24 gives tomorrow's (not yesterday) date/time if you are in
> England.
> If you want your own time zone, replace the [-][0-9]* with
> the value +24
> hours (yes, a "+" value)
> eg. if EST5EDT, use TZ=xxx29
> eg. if JST-9, use TZ=xxx15
>
> If you want daylight savings time, append the 'dst' info to
> the TZ variable.
> (see man environment)
>
> ...Rick
>
> > -----Original Message-----
> > From: IBM AIX Discussion List
[mailto:aix-l@Princeton.EDU]On Behalf Of
> Shawn Bierman
> Sent: December 9, 2003 4:06 PM
> To: aix-l@Princeton.EDU
> Subject: tomorrows date
>
>
> Is a statement like this always going to be correct?
>
> ksh TZ=SCG-24 date +%m%d%y
>
>
> Does it allow for leap years, time zone changes etc...?
>
> I just want it to give tomorrows date.
>
> -shawn
>



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:24 EDT