f



timezones and ntpdate

Hi, 

I'm a newbie when it comes to ntp, and I'm playing a little with ntpdate
trying to update the time of my PC's clock. I'm using the following
command:

ntpdate -u <server>

and my time is updated almost perfect...but with a difference of precise 2
hours. I think this problem is due to different timezones between me and
the server I connect to, but how do I avoid this?

Thanks in advance.

\holst
0
holst
6/29/2003 2:16:17 PM
comp.protocols.time.ntp 4895 articles. 2 followers. Post Follow

2 Replies
754 Views

Similar Articles

[PageSpeed] 43

In article <bdmsbh$8mk$1@sunsite.dk>, holst@control.auc.dk wrote:

> and my time is updated almost perfect...but with a difference of precise 2
> hours. I think this problem is due to different timezones between me and
> the server I connect to, but how do I avoid this?

FAQ.  It is not an NTP problem; it is a misconfiguration of your machine's
user interface.

I assume that the time seems to be two hours slow.  In that case,
you will probably find that from sh or bash, the command:

TZ=UTC0 date

gives the same as:

date

(on some operating systems e.g. the Red Hat Linux that an unspecified OS
typically means in a newbie question, on this group, date -u is the same as 
TZ=UTC0 date).

If that time is two hours earlier that Central European Summer Time, 
your OS kernel and NTP are working correctly and you need to configure
your user interface to display the time correctly, typically by setting
the TZ environment variable properly, or by installing the right default
timezone definition file (depends on the OS).

bash-2.05$ date -u
Sun Jun 29 18:04:46 UTC 2003
bash-2.05$ TZ=UTC0 date
Sun Jun 29 18:04:56 UTC 2003
bash-2.05$ date
Sun Jun 29 19:04:58 BST 2003
bash-2.05$ TZ=Europe/Copenhagen date
Sun Jun 29 20:05:11 CEST 2003
bash-2.05$ ls -l /etc/localtime
lrwxrwxrwx    1 root     root           22 Jan  7  2002 /etc/localtime -> /usr/share/zoneinfo/GB

(Actually done on Slackware Linux.  This format of TZ is only used on
the package that also allows the use of a default timezone file.)

> Content-Type: text/plain; charset=iso885915

Is this really a valid synonym for iso-8859-15?
0
david
6/29/2003 6:13:58 PM
Keep the computers internal time in UTC (GMT) and let the operating system
handle timezone offset.

Reynir Siik
Karlstad, Sweden

"holst" <holst@control.auc.dk> skrev i meddelandet
news:bdmsbh$8mk$1@sunsite.dk...
> Hi,
>
> I'm a newbie when it comes to ntp, and I'm playing a little with ntpdate
> trying to update the time of my PC's clock. I'm using the following
> command:
>
> ntpdate -u <server>
>
> and my time is updated almost perfect...but with a difference of precise 2
> hours. I think this problem is due to different timezones between me and
> the server I connect to, but how do I avoid this?
>
> Thanks in advance.
>
> \holst


0
Reynir
6/29/2003 6:42:26 PM
Reply: