Operating System - Linux
1753789 Members
7277 Online
108799 Solutions
New Discussion юеВ

Re: why should I use UTC instead of Localtime

 
SOLVED
Go to solution
Maaz
Valued Contributor

why should I use UTC instead of Localtime

NTP Server/Client OS: Linux

1
on ntp client why should I use UTC instead of Localtime or vice versa ?

some of the ntp client configured as Localtime, and some are configured as UTC, and both group shows right time, and no problem.

2
on ntp Server why should I use UTC instead of Localtime or vice versa ?

Regards
Maaz
6 REPLIES 6
Fredrik.eriksson
Valued Contributor
Solution

Re: why should I use UTC instead of Localtime

You should use UTC because it's "standard time". If you have software which adds timezone differance and you're running localtime then you might end up with 2xTimezone shifts (Normally this doesn't happen since most softwares get system time).

UTC also makes it easier to change the time if you're using Daylight Savings. It makes the transaction for some time critical software easier since you aren't really changing the real time, you're just changing timezone.

I would go for UTC, it's the most generic time you can get :)

My 2 cents on the issue :)

Best regards
Fredrik Eriksson
Ivan Ferreira
Honored Contributor

Re: why should I use UTC instead of Localtime

1) Use the timezone that corresponds with your location. Ensure that the Day Light Saving time change match your regional rules.

dzump -v | grep $(date +%y)

2) It does not matter the time zone that you use on the NTP server. The NTP server should have the time zone that match your region. NTP and machines always will work internally in UTC time, the date/time displayed to the user depends of the timezone that adds the "offset" required.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: why should I use UTC instead of Localtime

Hi Thanks Fredrik.eriksson, and Ivan Ferreira for help.

# zdump -v UZT | grep $(date +%y)
PKT -9223372036854775808 = NULL
PKT -9223372036854689408 = NULL

what does the
-9223372036854775808 = NULL
-9223372036854689408 = NULL
means ?

and in /etc/sysconfig/clock
HWCLOCK="-utc"
or
HWCLOCK="-u"
whats right ?

Regards
Ivan Ferreira
Honored Contributor

Re: why should I use UTC instead of Localtime

>> what does the
>> -9223372036854775808 = NULL
>> -9223372036854689408 = NULL
>> means ?

Probably that the zone specified does not exists. Use UTC in your command instead UZT.

>> and in /etc/sysconfig/clock
>> HWCLOCK="-utc"
>> or
>> HWCLOCK="-u"
>> whats right ?

I don't know about that value, Red Hat uses:

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s2-sysconfig-clock.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: why should I use UTC instead of Localtime

ok now whats the following output means

# zdump -v Asia/Karachi
Asia/Karachi -9223372036854775808 = NULL
Asia/Karachi -9223372036854689408 = NULL
Asia/Karachi Mon Dec 31 19:31:47 1906 UTC = Mon Dec 31 23:59:59 1906 PKT isdst=0 gmtoff=16092
Asia/Karachi Mon Dec 31 19:31:48 1906 UTC = Tue Jan 1 01:01:48 1907 PKT isdst=0 gmtoff=19800
Asia/Karachi Sun Oct 14 17:29:59 1945 UTC = Sun Oct 14 23:59:59 1945 PKST isdst=1 gmtoff=23400
Asia/Karachi Sun Oct 14 17:30:00 1945 UTC = Sun Oct 14 23:00:00 1945 PKT isdst=0 gmtoff=19800
Asia/Karachi Sat Sep 29 18:29:59 1951 UTC = Sat Sep 29 23:59:59 1951 PKT isdst=0 gmtoff=19800
Asia/Karachi Sat Oct 5 18:00:59 2002 UTC = Sun Oct 6 00:00:59 2002 PKST isdst=1 gmtoff=21600
Asia/Karachi Sat Oct 5 18:01:00 2002 UTC = Sat Oct 5 23:01:00 2002 PKT isdst=0 gmtoff=18000
Asia/Karachi 9223372036854689407 = NULL
Asia/Karachi 9223372036854775807 = NULL



Ivan Ferreira
Honored Contributor

Re: why should I use UTC instead of Localtime

If you read carefully, you will find for example:

Asia/Karachi Mon Dec 31 19:31:47 1906 UTC = Mon Dec 31 23:59:59 1906 PKT isdst=0 gmtoff=16092
Asia/Karachi Mon Dec 31 19:31:48 1906 UTC = Tue Jan 1 01:01:48 1907 PKT isdst=0 gmtoff=19800

In Dec 31, at 23:59, the time will go to Jan 1 01:01. The same information is displayed for UTC time (UTC = )
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?