1835518 Members
3106 Online
110078 Solutions
New Discussion

Re: GMT standard on hpux

 
SOLVED
Go to solution
Shivkumar
Super Advisor

GMT standard on hpux

Hi,

Are HPUX servers usually set their timezone with reference to GMT standard ? In case they are configured to take their time from a time sync server then what is the timezone of it ?

Thanks,
Shiv
4 REPLIES 4
Arunvijai_4
Honored Contributor

Re: GMT standard on hpux

Hi Shiv,

On HP-UX, you can set your time zone according to the place where you live (PST). If you want to reflect GMT, you can set that too.

For configuring NTP, check this out

http://docs.hp.com/en/B2355-90774/ch04s02.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Steven E. Protter
Exalted Contributor

Re: GMT standard on hpux

Shalom Shiv,

Time in HP-UX is measured as the number of ticks(seconds) since Jan 1, 1970.

All the TZ/Timezone information does is effect how its displayed on screen.

Connecting to a valid ntp souce, HP-UX will use any time zone you wish, even one you make up yourself.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor
Solution

Re: GMT standard on hpux

As far as world time goes, there is only one reference: GMT. Timezones are political, and have only a small relationship to the position of the sun in the sky. NTP also uses GMT which only makes sense since you can use time servers from all over the world.

The confusion comes when you see the time displayed or you change the time to match your current timezone. All the HP-UX time interfaces (system calls, libraries and programs like date) translate the GMT internal value to match the value of TZ. So your current timezone is:

echo $TZ

And anytime you type the date command, it is translated using the rules in /usr/lib/tztab. So you can have a user login from any location in the world and see the correct time by simply setting TZ to match their location as they login. You can also see other timezones in your current shell like this:

TZ=EST5EDT date
TZ=PST8EDT date

You see the time in those other timezones because the TZ value has been temporarily set to a different value. This is particularly useful because governments arbitrarily create or change the rules for a particular location and HP-UX has the tztab file to document the common locations and rules. See: man tztab

But here is the best part: you can make up your own timezone with your own rules. The man page for environ (man environ) describes how to create your own private timezone. For instance, here is my own (silly) timezone:

TZ=BILLH5:33 date

This shows the time based on GMT minus 5 hours and 33 minutes.

So the folks in the UK, Australia and next year, the United States, can easily change the rules and HP-UX users will be unaware of the new rules.

Now daylight saving rules are just an extension of the TZ value. TZ is simply translating GMT so the rules for switching to and from daylight saving are equally simple. The internal system time never changes -- only the interpretation. So the apparent jump in time at 2AM in the morning is just that, a translation of GMT time. So once you select the correct timezone , you can forget about time changes (until the politicians get nervous and decide it's time for a new law..).

So how do you set the timezone? There is a single file: /etc/TIMEZONE which is read automatically as each user logs in. This file is sourced in /etc/profile and becomes the default time for each user. But TZ can be changed for each user if needed by editing .profile and changing TZ to match their local timezone.

So using NTP requires no knowledge of local timezones. GMT (aka, Zulu or UTC) is the worldwide standard and NTP will always set your local computer correctly. If the time is off by an hour or two, check TZ first.


Bill Hassell, sysadmin
Shivkumar
Super Advisor

Re: GMT standard on hpux

It is a great experience to read the response from the Bill and SEP.

Regards,
Shiv