9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Date woes
Date: Tue, 23 Apr 2013 14:55:32 -0700	[thread overview]
Message-ID: <20130423215532.7D855B82A@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Tue, 23 Apr 2013 15:30:03 +0200." <20130423133003.GB19997@polynum.com>

On Tue, 23 Apr 2013 15:30:03 +0200 tlaronde@polynum.com wrote:
> IIRC, I did not use this Plan9 node since the CET Saving Time switch.
>
> When verifying a directory listing (fossil) I saw:
>
> The correct date (time) on the file (I mean the correct time in CEST).
>
> An incorrect time on the command line: it was 2 hours _backward_. And
> when rebooting, the CMOS was being reset with this 2 hours error (from
> UTC).

setrtc just copies the first number from /dev/time (in UTC) to
RTC. This is obviously wrong if your RTC maintains localtime.
But RTC is just a dumb oscillator so it can't adjust for
daylight saving time.

My guess as to what must be happening: If you did fshalt prior
to DST and your localtime is an hour ahead of UTC, setrtc
introduces an error of one hour. So for example, on the day
before DST switchover, when local time is 8pm, rtc will show
7pm. Now 24 hours later local time is 9pm due to daylight
saving but rtc will still show 7pm. Now timesync with -rL will
assume this is correct and proceed to make a two hour
"correction".

The filesystem stores timestamps in UTC and it just believes
whatever the kernel tells it. As it should.

Just use TIMESYNCARGS-(-n pool.ntp.org) or some such.

Finally if you are running Windows 7 *and* have a recent
hotfix 2800213 installed, you *can* use UTC in RTC by registry
entry RealTimeIsUniversal=1. Or so I am told! Finally, 20+
years later, microsoft does the right thing when they could've
fixed this in 3.1.



  parent reply	other threads:[~2013-04-23 21:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 13:30 tlaronde
2013-04-23 13:34 ` erik quanstrom
2013-04-23 14:34   ` tlaronde
2013-04-23 15:16     ` erik quanstrom
2013-04-23 16:16       ` tlaronde
2013-04-23 16:59         ` erik quanstrom
2013-04-23 17:36           ` tlaronde
2013-04-23 21:55 ` Bakul Shah [this message]
2013-04-24 10:52   ` tlaronde
2013-04-24 11:26     ` tlaronde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130423215532.7D855B82A@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).