[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: time zone and UTC issue

On 28/11/12 03:54 PM, Eike Lantzsch wrote:

On Wednesday 28 November 2012 10:09:42 Ralf Mardorf wrote:

> On Wed, 2012-11-28 at 15:55 +0530, J. B wrote:

> > Hello list,

> >

> > My box is configured to the local time zone from beginning, both hwclock

> > and system time. But linux always favor hwclock to UTC. What is the

> > advantage of doing that ?

Your hwclock stays put and daylight saving and latitude is managed by tzdata to show local time. File time-stamps are set to local time, however.

Please correct me if I'm wrong.




The document distinguishes between a Linux-only-system and a double-boot-system with MS Windows.


In the case of double boot you should set hwclock to local time, as mentioned in the document, or follow the advice by Andrei Popescu and set hwclock to UTC and let WIndows also show UTC. That is useful for radio amateurs who log their activity in UTC anyway.


> >

> > If I need my hwclock to UTC then what should be the right way to do that

> > ? I have followed "dpkg-reconfigure tzdata" and found it has changed the

> > local time to UTC too. Confused .....

Well, J.B. you did something wrong then.

Please show us exactly which steps you did - command by command. Did you set hwclock in the BIOS and then rebooted or did you use "hwclock -u"?


Please show us:

"hwclock -r"


"date -u"


contents of:





Then we might be able to find out where the snag lies.



> The Linux has to know if the hwclock does use UTC or not and then it

> will set up the clock, when running a Linux to the correct time for your

> timezone. IOW you only have to inform what time hwclock does use.

hwclock --utc


> I'm living in Germany, if my hwclock would use UTC time, then saving

> e.g. BIOS settings, would add a wrong time to the files. So I can't see

> an advantage in using UTC. I'm using local time for the hwclock.

Well, Ralf, that wasn't exactly the setting of the OP or was it?

Why do you think that the file creation time is set to UTC and not local time unless your system time is UTC too?

File timestamps are set according to system time - always, or did I miss something?



hwclock --systohc --utc


username@hostname:~$ touch filetimetest

username@hostname:~$ ls -la |grep timetest

-rw-r--r-- 1 user group 0 Nov 28 11:42 filetimetest

username@hostname:~$ date -u

Wed Nov 28 14:43:01 UTC 2012

username@hostname:~$ date

Wed Nov 28 11:43:03 PYST 2012


Kind regards



File stamps are unix time. This is the number of seconds since midnight, January 1, 1970 (UTC) not counting leap seconds. This is also how the Linux clock tracks time so that no calculations are required when saving the current time as a file's time stamp. The time displayed on your computer is simply a human-readable interpretation of the internal clock based on your time zone settings.

The only way that the timezone and BIOS clock settings come into play is if they are wrong! If you tell the computer you're in the wrong time zone, it will believe you and act accordingly. However, anyone running ntp or chrony has to work to get the wrong time stamps on files.

Reply to: