You are not logged in.

#1 2012-12-24 16:25:51

White girl
Member
Registered: 2012-12-24
Posts: 34

Another time issue, except this one is probably unique

For starter, I'm in Moscow, Russia (Europe/Moscow, UTC +4000) where we don't have DST (anymore). My hardware clock isn't set on UTC, it's set to my timezone.

I dual boot Windows 7, I've done the registry hack for the clock to be set on UTC instead of localtime due to the nagging that I shouldn't use localtime. Arch is also set on UTC.

I've done the quick hack fix by setting the timezone to Europe/London so localtime won't offset the time (because like all applications read localtime instead of UTC), but it has DST mode enabled, which I don't need.

Here's the result of timedatectl status:

      Local time: Mon, 2012-12-24 20:24:39 GMT
  Universal time: Mon, 2012-12-24 20:24:39 UTC
        RTC time: Mon, 2012-12-24 20:24:39
        Timezone: Europe/London
      UTC offset: +0000
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: BST → GMT, DST became inactive
                  Sun, 2012-10-28 01:59:59 BST
                  Sun, 2012-10-28 01:00:00 GMT
 Next DST change: GMT → BST, DST will become active
                  the clock will jump one hour forward
                  Sun, 2013-03-31 00:59:59 GMT
                  Sun, 2013-03-31 02:00:00 BST

I wonder if there's any better solution to this problem?

Last edited by White girl (2012-12-25 19:06:03)

Offline

#2 2012-12-24 16:35:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Another time issue, except this one is probably unique

What makes you think your situation is unique?  Many regions don't follow DST, and even among those that do there are many different adjustments that are used.

You say both windows and arch are set to use UTC, but your hardware clock is still on local time, why?  Set the hardware clock to UTC.

Lastly, you seem to be looking for a solution to a problem ... but you haven't described any problems - what is currently wrong?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2012-12-24 16:46:58

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Another time issue, except this one is probably unique

Trilby wrote:

What makes you think your situation is unique?  Many regions don't follow DST, and even among those that do there are many different adjustments that are used.

You say both windows and arch are set to use UTC, but your hardware clock is still on local time, why?  Set the hardware clock to UTC.

Lastly, you seem to be looking for a solution to a problem ... but you haven't described any problems - what is currently wrong?

Excuse me that I did not mention what I wanted to achieve. I want to be able to set the timezone back to Europe/Moscow so it would disable DST, but doing so will offset the time by 4 hours for every applications.

To my knowledge, hardware clock is already set to UTC after executing the command "timedatectl set-local-rtc 0", and hardware clock is still set on my timezone.

Last edited by White girl (2012-12-24 16:48:20)

Offline

#4 2012-12-24 16:53:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Another time issue, except this one is probably unique

I don't have much experience with timedatectl, have you tried

# hwclock -w

Note that either timedatectl, or hwclock would have to be run as root or with sudo to be able to set the hardware clock.

If you're hardware clock is not on UTC time, then setting to Europe/Moscow would be expected to give incorrect times.

EDIT: either of these would have to be used *after* you set the clock to the appropriate UTC time rather than local Moscow time.
In other words: 1) set the system time to the correct UTC time (ntp can be helpful); 2) set the hwclock to the current sysclock time; 3) change the timezone to Europe/Moscow.

Last edited by Trilby (2012-12-24 16:56:23)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2012-12-24 18:06:41

White girl
Member
Registered: 2012-12-24
Posts: 34

Re: Another time issue, except this one is probably unique

Trilby wrote:

I don't have much experience with timedatectl, have you tried

# hwclock -w

Note that either timedatectl, or hwclock would have to be run as root or with sudo to be able to set the hardware clock.

If you're hardware clock is not on UTC time, then setting to Europe/Moscow would be expected to give incorrect times.

EDIT: either of these would have to be used *after* you set the clock to the appropriate UTC time rather than local Moscow time.
In other words: 1) set the system time to the correct UTC time (ntp can be helpful); 2) set the hwclock to the current sysclock time; 3) change the timezone to Europe/Moscow.

That works, thanks.

EDIT: hardware clock is back to localtime, probably after reboot. What should I do to make hardware clock stay on UTC?

Last edited by White girl (2012-12-25 19:05:25)

Offline

Board footer

Powered by FluxBB