[ntp:questions] Re: Problems with the Timezone

Martin Burnicki martin.burnicki at meinberg.de
Wed May 10 16:27:10 UTC 2006


Marvin Garcia wrote:
> Thanks Martin, see the lines bellow
> root at snbntp0201 # echo $TZ
> GMT-4
> root at snbntp0201 # date; date -u
> Wed May 10 19:35:04 GMT 2006
> Wed May 10 15:35:04 GMT 2006
> What i mean is that instead of subtract 4 it sum 4 to the GMT ... Do
> you see the diferences?
> I think this is ilogical or am i doing something wrong?

Yes, you're thinking wrong about the TZ variable. The first 3 letters (in
your case GMT) should be an abbreviation of your local time zone name. 

The following number is the UTC offset from your local standard time, in
your case: UTC = (local time) -4 hours.

A 3rd field of letters may be appended to indicate that daylight saving time
(DST) is currently in effect and thus there's an additional offset to take
into account. For my system here (located in Germany) I get the following:

# date -u
Wed May 10 16:06:21 UTC 2006  # This is the current UTC time

# TZ=CET-1 date
Wed May 10 17:06:21 CET 2006  # My standard local time

# TZ=CET-1CST date
Wed May 10 18:06:21 CST 2006  # My local time when DST is effective

Please note that this notation is very old. There have been extensions to
this which define automatically beginning and end of DST, and current OS
versions often use a timezone/zoneinfo/tz database which lets you select
your current local time zone and also provides information of beginning/end
of DST in the past. The latter lets you select a time zone like
Europe/Berlin or similar. Please refer to your operating system manual on
how to select your time zone properly.

Anyway, if your ntpd syncs to internet NTP time servers which work correctly
and changes time if you use your local refclock then there seems to be
something wrong with your local refclock configuration, at the device or in

Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont

More information about the questions mailing list