Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215737 - reading hardware clock localtime ambiguity
Summary: reading hardware clock localtime ambiguity
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-01 18:26 UTC by Imre Péntek
Modified: 2008-04-02 15:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Imre Péntek 2008-04-01 18:26:02 UTC
Hello, I think somehow gentoo could store if the clock was left in summer time, or "winter" time, so it can also read impossible and/or ambiguous dates properly. Maybe someone would turn on his/her computer at 03:03 when the clock was skew from 02:00 to 03:00. This way the sysclock would report 02:03, an impossible date.
Or when skewing clock from 03:00 to 02:00 -- the time 02:03 would be abiguous. As this "feature" is dependent of user choices (using localtime, and saving sysclock on shutdown), it should be optional and setting-dependent (like a new option, or using the previous condition)

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2008-04-01 21:40:08 UTC
interpreting of time is for the user and their configuration, not for Gentoo scripts.  we already have the flexibility you desire:
 - /etc/conf.d/hwclock
   - is the hardware clock local or UTC
   - should the system clock be written to the hardware clock at shutdown
 - /etc/timezone
   - what timezone are you in and what sort of local rules are used

with this little bit of information, you can extrapolate everything else.
Comment 2 Imre Péntek 2008-04-02 13:39:58 UTC
As it is never, nowhere stored when the user shut down the computer last time (there was summer time? winter time? who knows?) I suspect that I cannot extrapolate the correct date/time value in this situation.
As my computer booted yesterday the clock was set improperly. I think this is so general problem it could be addresed globally by you, not locally by me.
Comment 3 SpanKY gentoo-dev 2008-04-02 14:54:09 UTC
the time of the last shutdown is irrelevant at the next boot up.  it is also nigh impossible (certainly outside the realm of doable) to describe the time in the terms you want as those terms are largely region/user specific and change constantly.

you declare in the configuration files how to interpret the time value stored in your hwclock.  make sure things match and the time will be correct.  working around incorrect configuration settings is wrong -- configure your clock correctly in the first place.
Comment 4 Imre Péntek 2008-04-02 15:49:20 UTC
the exact time of last shutdown is irrelevant. The only relevant part is whether systohc stored the time before or after the current clock skew.
I declare if the clock should be interpreted as localtime or GMT. But in localtime option, there is no chance for the system (even for the user) to decide if it was stored the last time in summer time or not.
I followed the handbook, so my config should be OK.
I still don't see how my Gentoo could guess when it reads 2008. april 02 16:46 from the hwclock how it can/will decide if last time it was stored using winter time (since (say) my computer was shut down at 2008 january 12 03:44), so it would be interpreted as 2008. april 02 17:46
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2008-04-02 15:58:21 UTC
You just learned why storing your time in localtime is a bad practice and can lead to time issues. This is why everyone but Windows stores their time in UTC and people with Windows machines scratch their head as to why their clock is wrong sometimes.

Long story short, configure your clock correctly and this won't happen.