Re: tomorrows date

From: Green, Simon (Simon.Green@EU.ALTRIA.COM)
Date: Thu Dec 11 2003 - 05:33:27 EST


I can't speak for HP-UX, but AIX (4.3.3 and 5.1-04) is perfectly happy to
accept larger TZ offsets than 24. I just verified it with +/-48, but it
will also cope with quite ludicrous values.

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: Robert Binkley [mailto:rbinkl@COMCAST.NET]
> Sent: 10 December 2003 15:18
> To: aix-l@Princeton.EDU
> Subject: Re: tomorrows date
<SNIP>
> [the TZ trick]
> If the system is located WEST of the Greenwich Meridian (ie - in the
> Americas), you can determine tomorrow's date by temporarily
> subtracting
> 24 hours from the timezone offset, like so:
>
> $ offset=`echo $TZ | tr -d '[A-Z+]'`
> $ new_offset=`echo $offset - 24 | bc`
> $ TZ=`echo $TZ | sed "s/[+-]\{0,1\}[1-9][0-9]\{0,1\}/$new_offset/` \
> date +%D
>
> Unfortunately, in this part of the world, a similar method
> method cannot
> be used to obtain yesterday's date, because, under HP-UX, the timezone
> offset can not be greater than +24.
>
> If the system is located EAST of the Greenwich Meridian (ie -
> in Europe),
> you can determine yesterday's date by temporarily adding 24
> hours to the
> timezone offset, like so:
>
> $ offset=`echo $TZ | tr -d '[A-Z+]'`
> $ new_offset=`echo $offset + 24 | bc`
> $ TZ=`echo $TZ | sed "s/[+-]\{0,1\}[1-9][0-9]\{0,1\}/$new_offset/` \
> date +%D
>
> Unfortunately, in this part of the world, a similar method
> method cannot
> be used to obtain tomorrow's date, because, under HP-UX,AIX
> the timezone
> offset cannot be less than -24.



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