Re: tomorrows date

From: Robert Binkley (rbinkl@COMCAST.NET)
Date: Wed Dec 10 2003 - 10:10:20 EST


Some of the many examples were one line PERL commands:-

% perl -e 'use POSIX qw(strftime); print strftime("%x\n", localtime(time));'
11/27/00

% perl -e 'use POSIX qw(strftime); print strftime("%x\n", localtime(time -
86400));'
11/26/00

% perl -e 'use POSIX qw(strftime); print strftime("%x\n", localtime(time -
7*
86400));'
11/20/00

...To moving your timezone back!

# env TZ=MET+24 date +'%m/%d/%y'

Robert Lee Binkley
5009 Silver Oak
Sherwood ark 72120
** rbinkl@comcast.net <mailto:rbinkl@comcast.net>
** ************
** ************

-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
Shawn Bierman
Sent: Wednesday, December 10, 2003 8:53 AM
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:23 EDT