Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re[2]: [gentoo-user] Server system date synchronizaion
Date: Fri, 26 Apr 2013 22:12:26
Message-Id: CAEH5T2Of3p4=xMHKtySmFgMAvk=uvHjO5DTCDObv8OxQ1Rqe_w@mail.gmail.com
In Reply to: Re: [gentoo-user] Re[2]: [gentoo-user] Server system date synchronizaion by Alan McKinnon
1 On Fri, Apr 26, 2013 at 3:54 PM, Alan McKinnon <alan.mckinnon@×××××.com> wrote:
2 > On 26/04/2013 22:46, the guard wrote:
3 >> Пятница, 26 апреля 2013, 22:41 +02:00 от Alan McKinnon <alan.mckinnon@×××××.com>:
4 >>> Do none of us here ever deal with Windows? :-)
5 >>>
6 >>> I notice that no-one has yet mentioned that Windows does not do ntp, as
7 >>> Windows does not do time right, doesn't do timezones right and I
8 >>> strongly suspect can't even do dates right (this latter still unproven)
9 >>>
10 >>> Windows time servers need some magic Microsoft thing called ENTP which
11 >>> is in no way related to the ntp we all know and love
12 >>>
13 >> It refuses to adjust time if you have a wrong date. timezone is set in your system
14 >>
15 >
16 >
17 > I was thinking more along the lines of how Windows has no concept of UTC
18 > set in the hw clock and a local timezone, and how timezones are odd
19 > things like Harare/Pretoria instead of the official names like
20 > SAST GMT+2 as set by the scientific timekeeping community.
21 >
22 > How about daylight savings? Can Windows deal with that? Other than by
23 > just shoving the clock back and forward by an hour on the right days?
24
25 I've used windows for the past 25,000+ work hours at my job (I wish
26 that were an exaggeration) in an all-Microsoft corporate environment.
27 I dare not declare myself an expert in anything Windows so as not to
28 encourage more of it. :)
29
30 AFAIK the windows time service (w32time) does everything internally
31 and between machines using UTC, but translates to/from local time for
32 updating the hardware clock and the OS time. When daylight saving time
33 happens it just changes the clock, though I have heard of some sites
34 where the time change does not occur until the next time sync happens.
35 If DST happens when the machine is powered off, it changes it at the
36 next reboot (and usually pops up a little window to let you know what
37 has happened). Sometimes if you reboot multiple times on a DST
38 changeover day it can adjust the clock repeatedly...
39
40 If you haven't installed Windows Updates or are using an unsupported
41 version, your DST and time zone info may be outdated. For example, in
42 the US about 10 years ago they changed the start and end of DST by a
43 few weeks. Any devices using the old logic will be wrong for about a
44 month out of the year. If someone manually "fixes" the time on their
45 workstation, it will be correct until it changes itself and then it'll
46 be wrong again. :)
47
48 Also, being Windows, people tend to set the wrong time zone, don't
49 check the "use daylight saving" box, choose Central America
50 (continent) instead of Central US (country) time zone, etc. Then they
51 send out meeting invitations in Outlook and the time gets shifted by
52 the Exchange server and everybody shows up to a conference room an
53 hour early, except for the person who organized the meeting,
54 naturally.
55
56 Time sync has been built into Windows since Win 2000, and machines who
57 are part of a domain sync time with their domain controller using some
58 proprietary protocol called NT5DS. If you have admin rights you can
59 edit the registry and change it to use plain old NTP and sync with a
60 regular NTP server. The DC can sync with other DCs or standard NTP
61 server(s) over the internet. Home machines w/o a domain can set an NTP
62 server in the date and time settings without messing with the
63 registry, I think. (I don't use Windows at home.)
64
65 The time sync service by default changes the time gradually, taking up
66 to an hour to make the adjustment when there is a difference. Not sure
67 if there is an upper limit where it refuses to adjust if it's "too
68 wrong". You can also force an immediate sync in those cases.
69
70 There is a multi-purpose time utility built-in to windows called
71 w32tm.exe that lets you do various time operations, giving some
72 insight into the way Windows sees the world. I can do things like:
73
74 C:\Windows\system32>w32tm /tz
75 Time zone: Current:TIME_ZONE_ID_DAYLIGHT Bias: 360min (UTC=LocalTime+Bias)
76 [Standard Name:"Central Standard Time" Bias:0min Date:(M:11 D:1 DoW:0)]
77 [Daylight Name:"Central Daylight Time" Bias:-60min Date:(M:3 D:2 DoW:0)]
78
79 The interesting part there is UTC=LocalTime+Bias. So that seems to be
80 how they handle that. The other lines show what it knows about when
81 DST kicks in and the additional bias.
82
83 C:\Windows\system32>w32tm /query /status
84 Leap Indicator: 0(no warning)
85 Stratum: 4 (secondary reference - syncd by (S)NTP)
86 Precision: -6 (15.625ms per tick)
87 Root Delay: 0.2329102s
88 Root Dispersion: 0.3298777s
89 ReferenceId: 0x0A010046 (source IP: 10.1.0.70)
90 Last Successful Sync Time: 4/26/2013 10:37:44 AM
91 Source: DC1.example.com
92 Poll Interval: 15 (32768s)
93
94 Tells me about the time sync status on my workstation and info about
95 the last sync.
96
97 C:\Windows\system32>w32tm /stripchart /computer:time-a.nist.gov /samples:10
98 Tracking time-a.nist.gov [129.6.15.28:123].
99 Collecting 10 samples.
100 The current time is 4/26/2013 4:08:03 PM.
101 16:08:03 d:+00.0467925s o:-00.2902514s [ *|
102 ]
103 16:08:05 d:+00.0623842s o:-00.2958840s [ *|
104 ]
105 16:08:07 d:+00.0311857s o:-00.2882881s [ *|
106 ]
107 16:08:09 d:+00.0467864s o:-00.2917686s [ *|
108 ]
109 16:08:11 d:+00.0467916s o:-00.2846576s [ *|
110 ]
111 16:08:13 d:+00.0467925s o:-00.2963050s [ *|
112 ]
113 16:08:15 d:+00.0467925s o:-00.2963291s [ *|
114 ]
115 16:08:17 d:+00.0467919s o:-00.2949080s [ *|
116 ]
117 16:08:19 d:+00.0467897s o:-00.2966004s [ *|
118 ]
119 16:08:21 d:+00.0311927s o:-00.2887318s [ *|
120 ]
121
122 Measuring differences between my machine and another one. Notice here
123 I'm querying one of the same standard time servers I sync with on my
124 Gentoo machines.
125
126 Now we return to our regularly-scheduled programming...

Replies

Subject Author
Re: [gentoo-user] Re[2]: [gentoo-user] Server system date synchronizaion Alan McKinnon <alan.mckinnon@×××××.com>