Operating System - HP-UX
1834395 Members
2702 Online
110066 Solutions
New Discussion

date and timezone problem

 
kholikt
Super Advisor

date and timezone problem

I have a HPUX machine with the correct time zone

/etc/TIMEZONE
SST-8

but from the date command it shows SST only why
Tue Apr 23 17:20:21 SST 2002

abc
6 REPLIES 6
Sukant Naik
Trusted Contributor

Re: date and timezone problem

Hi kholikt,

I checked my server here and it contains two lines in the /etc/TIMEZONE file.

# cat TIMEZONE
TZ=IST-5:30
export TZ

When I saw your file, it contains only one line. Just add export TZ

Regards,

Sukant
Who dares he wins
Clemens van Everdingen
Honored Contributor

Re: date and timezone problem

Hi,

My TIMEZONE file contains two lines:

TZ=MET-1METDST
export TZ

date output is:

Tue Apr 23 11:36:30 METDST 2002

That's correct.

C.

The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Mateja Bezjak
Respected Contributor

Re: date and timezone problem

Hi,

On my machine date also shows abbreviated TZ

# cat /etc/TIMEZONE
TZ=MET-1MEST
export TZ
# date
Tue Apr 23 11:33:09 MEST 2002
Deepak Extross
Honored Contributor

Re: date and timezone problem

Hi,
The date and time indicated by the output of 'date' is already adjusted by 8 hrs from GMT, so there is no need to repeat "-8".
You can verify this by setting TZ to GMT using
export TZ=GMT
and run the 'date' command again. It will now display the GMT time.
Trond Haugen
Honored Contributor

Re: date and timezone problem

This is correct. I belive because date only displays the timezone name.
# echo $TZ
MET-1METDST
# date
Tue Apr 23 11:42:20 METDST 2002
# TZ=SST-8
# date
Tue Apr 23 17:42:37 SST 2002

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Frank Slootweg
Honored Contributor

Re: date and timezone problem

If you mean that the date(1) command does not show the "-8", then that is *correct*. It should *adjust* for the "-8", but should not *display* it. See also Clemens' example for MET-1METDST which does not display the "-1".

If this is not your problem/question then please clarify.

For what it is worth, I could not find a timezone "SST" in /usr/lib/tztab. If you have one, then please post it (The *complete* entry, i.e. starting with the comments *above* "SST...", *to* the next blank line.).
For details, see the tztab(4) manual page.