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.
ref:
http://www.tldp.org/HOWTO/TimePrecision-HOWTO/set.html
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"
"date -u"
contents of:
/etc/adjtime
/etc/default/hwclock
/etc/timezone
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?
Here:
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
Eike
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.