1833883 Members
1900 Online
110063 Solutions
New Discussion

NTP Timezone

 
j773303
Super Advisor

NTP Timezone

How to define the TIMEZONE for NTP ?
What's the difference EAT-8 and CST6CDT?
Hero
8 REPLIES 8
Bill Hassell
Honored Contributor

Re: NTP Timezone

NTP (ike most Unix flavors) have only ONE timezone: GMT or the more modern term UTC (Universal Coordinated Time) or Zulu. NTP keeps the Unix timeclock accurate to within 128ms of Zulu time. Timezones are political, not astrometrical so Unix allows every user to define their own representation for local time. This is done through the TZ environmental variable and can be changed at will for a given session. TZ is normally set in /etc/profile (from the file: /etc/TIMEZONE) and for international logins, changed to match the local time.

All the definitions for each TZ value are in the file: /usr/lib/tztab and of course the man page for tztab will help.

One nit: for programs (typically some daemons) that do not define or inherit the TZ environment value, the HP-UX system calls for time-of-day are adjusted with the kernel parameters timezone and dst. This is a much more crude method (minutes east/west of the Greenwich meridian) as it does not have the dozen of more variations for daylight saving.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: NTP Timezone

Timezone is not defined in ntp.

You set your timezone in /etc/TIMZONE

mine looks like this:

TZ=CST6CDT
export TZ


Central time btw.

ntp just points to the server to get time from. It doesn't matter where it is. The system adjusted the time to fit your timezone.

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
Michael Tully
Honored Contributor

Re: NTP Timezone

I'm assuming your in China ??

Then your zone is -8 being 8 hours ahead of GMT (0 hours).
CST6CDT is central canadian time. 6 hours behind GMT.

As far as I know NTP does not have a definition for timezones.
Anyone for a Mutiny ?
A. Clay Stephenson
Acclaimed Contributor

Re: NTP Timezone

To add to this, in a very real sense there is no such thing as a system-wide timezone. Of course, there is a default TZ but TZ can be set for each user or even each process. It is perfectly normal for users to have different timezone settings on the same server. After all, remote users might be logged in remotely from thousands of miles away. All UNIX boxes simply count seconds from 00:00 UTC 1-Jan-1970.
Timezone settings only affect how time is displayed. The chief effect of the system-wide timezone setting in /etc/TIMEZONE is that it is used as a default for processes like crond.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: NTP Timezone

Umm...Michael, CST6CDT is Central Standard Time / Central Daylight Time and is in use in the whole of North America (US and Canada). ;)

Patrick Wallek
Honored Contributor

Re: NTP Timezone

Umm...Michael, CST6CDT is Central Standard Time / Central Daylight Time and is in use regiionally in the whole of North America (US and Canada). ;)

Suresh Patoria
Super Advisor

Re: NTP Timezone

Hi,

You define the timezone in /etc/TIMEZONE file

and check the timezone using the command echo $TZ
Suresh Patoria
Super Advisor

Re: NTP Timezone

Hi,

You define the timezone in /etc/TIMEZONE file

and check the timezone using the command echo $TZ