Re: Problems with the Timezone



Marvin,

Marvin Garcia wrote:
This is what i have en the ntp.conf file.
[...]
Looks OK.

Look this again
root@snbntp0201 # date
Wed May 10 21:41:57 GMT 2006
root@snbntp0201 # date -u
Wed May 10 17:42:00 GMT 2006
root@snbntp0201 # echo $TZ
GMT-4

if you see my timezone var is set to GMT-4 (this is the one that
belongs to me location). the system date (Wed May 10 21:41:57 GMT
2006) should be (Wed May 10 17:42:00 GMT 2006) - 4 = Wed May 10
13:42:00 GMT 2006 not (Wed May 10 17:42:00 GMT 2006 )+ 4 = Wed May 10
21:41:57 GMT 2006, because my GMT is set to GMT-4.

As already mentioned in my other post, the old TZ thing works exactly the
other way round. If your local time is GMT - 4 hours (or let's better call
it UTC - 4 hours) then you must set the TZ environment variable to GMT4
because the definition is UTC = local time + TZ value. Just try:

date -u # returns UTC time
TZ=GMT4 date # displays UTC time - 4 hours

On my system is looks like this:

# date -u
Wed May 10 19:57:38 UTC 2006
# TZ=GMT4 date
Wed May 10 15:57:40 GMT 2006

I think the result is what you expect. However, "GMT" is a poor choice for
the abbreviation of the time zone name since it implies that the displayed
time is GMT, which in fact it isn't. Better use a abbreviation which is
associated to what you call your local time zone.

Anyway, using TZ this way is outdated and you should preferably configure
your time zone maybe as "America/Santo_Domingo", as Richard B. Gilbert
proposed in one of his posts.


Martin
--
Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont
Germany

.



Relevant Pages

  • Re: Network Time Protocol (NTP) client support question
    ... compensating adjustment to the time zone offset. ... The whole point of using UTC time stamps is to avoid issues ... fudging the local time offset fails to satisfy it. ...
    (bit.listserv.ibm-main)
  • Re: convert time string in UTC to time in local time
    ... I have a time stamp that looks like this (corresponding to UTC time): ... I want to convert it to my local time. ... time zone magic to treat the supplied time as a local time, ... UTC time - this seems to be an artifact of the way mktime is defined ...
    (comp.lang.python)
  • Re: Rotor Bug: TimeZone ToLocalTime
    ... Or are you just basing this on a code examination? ... all of the information from the time zone about how to offset the times. ... into a local time fails, but not converting a utc date into a local date. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: How to compare DateTime Objects?
    ... If the server records in GMT ... It does not matter what time zone the ... server is actually in as long as it records in UTC. ... display based on their local time. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Question about ISO8601 vs. strftime()
    ... online references to ISO8601 just get it wrong? ... that link only shows the form with the UTC ... but not the offset as far as I can tell. ... assumed to be in some local time zone. ...
    (comp.programming)