Discussion:
write access to clock?
(too old to reply)
J. P. Gilliver
2023-07-24 12:30:49 UTC
Permalink
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).

Yes, I know W7 has its own time sync. mechanism (I think XP did too);
I'd just rather like my old application to be able to do so, for
nostalgia reasons if nothing else. FWIW, both the internal and my old
application point to the same time server. Manually invoking a
correction using W7's own mechanism _did_ result in the clock being
corrected, as you'd expect.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Paxman, the man who has never used one sneer when three would do
- Elizabeth Day, RT 2015/5/2-8
David E. Ross
2023-07-24 15:03:07 UTC
Permalink
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Yes, I know W7 has its own time sync. mechanism (I think XP did too);
I'd just rather like my old application to be able to do so, for
nostalgia reasons if nothing else. FWIW, both the internal and my old
application point to the same time server. Manually invoking a
correction using W7's own mechanism _did_ result in the clock being
corrected, as you'd expect.
What is your "old application"?

I am using SocketWatch on Windows 7. It seems able to update my system
clock.
--
David E. Ross
<http://www.rossde.com/>

Is it possible that a Republican agent planted the
cocaine in the White House in an attempt to discredit
President Biden?
J. P. Gilliver
2023-07-24 15:45:04 UTC
Permalink
Post by David E. Ross
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Yes, I know W7 has its own time sync. mechanism (I think XP did too);
I'd just rather like my old application to be able to do so, for
nostalgia reasons if nothing else. FWIW, both the internal and my old
application point to the same time server. Manually invoking a
correction using W7's own mechanism _did_ result in the clock being
corrected, as you'd expect.
What is your "old application"?
I am using SocketWatch on Windows 7. It seems able to update my system
clock.
Turnpike - a news/email client (well, I suppose you'd call it a suite,
as it includes various other things, like ping, finger, telnet,
traceroute, and the time thing; I mainly use only the news and email
parts). Ceased development 2007. But the question was general. (TP
checks [and tries to correct] the time on connecting, and at settable
intervals - I have it set to 24h, which I think is the default.)
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

(please reply to group - they also serve who only look and lurk)
(William Allen, 1999 - after Milton, of course)
VanguardLH
2023-07-24 17:57:31 UTC
Permalink
Post by J. P. Gilliver
Turnpike - a news/email client (well, I suppose you'd call it a suite,
as it includes various other things, like ping, finger, telnet,
traceroute, and the time thing; I mainly use only the news and email
parts). Ceased development 2007. But the question was general. (TP
checks [and tries to correct] the time on connecting, and at settable
intervals - I have it set to 24h, which I think is the default.)
But NTP (Network Time Protocol) servers are not NNTP servers. Wrong
place to get the time. Just like clients, NNTP servers can have the
wrong time until you notify the owner of the discrepancy.

The NTP client in Windows is often set to poll the MS NTP
(time.windows.com) server, but that server is so busy that often your
client cannot connect. The NIST server is less busy (time.nist.gov).
Both those are home is the USA. If your nearby university has an NTP
server, it may be public, so you could use that. Do a search on
"<university> NTP". Instead I use one of the ntp.org pools of NTP
servers. For me is the USA, I use us.pool.ntp.org which is a pool of
NTP servers in the USA. I could drill down further, like to do by
state, but I use the national pool. If a server is busy, they pass the
NTP request to another server in the pool. You can more info at
ntp.org, like the pools of NTP servers they have that you can use (see
https://support.ntp.org/Servers). You want to use one that is listed as
OpenAccess.

You edit the registry to add more NTP servers to the list you see in the
timedate.cpl wizard under its Internet Time tab and Change Settings
button. Once you add an NTP server, go there to pick that one from the
drop-down list. That list of NTP servers is stored in the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers

Add another data item (type REG_SZ), give it a numeric name, and its
data item's value is the hostname of the NTP server. Just the name, no
protocol (do not add ntp://), like us.pool.ntp.org.

Various NTP pools are available at ntp.org depending on how far away you
want to limit where they are from you (farther away does not necessary
mandate more hops in the route than one closer to you).

Worldwide: pool.ntp.org
Asia: asia.pool.ntp.org
Europe: europe.pool.ntp.org
North America: north-america.pool.ntp.org
Oceania: oceania.pool.ntp.org
South America: south-americal.pool.ntp.org

You can see those listed at:

https://support.ntp.org/Servers/NTPPoolServers

If you want a smaller pool, click on one of the regional pools. For
further granulation, click on a sub-region to see if there are any more
sub-pools.

NTP.org works like many NTP clients that contained their own list of NTP
servers, but that list gets out of date, so you could end up polling
servers that no longer exist. Some NTP clients will try to find the NTP
server with the least delay to you in a route along with the most
responsive. They weight entries in their list, reuse those, but still
gather stats on other servers in their list to see if others have become
better. I used to use SockeWatch as an NTP client, and it had those
features. Alas, its NTP server list is old, and I had to edit its list
(you'll have to guess at the syntax) to get rid of dead entries to
eliminate any time spent on testing those defunct NTP servers. With
NTP.org's pools, I let them figure out which is the best NTP server for
me to use, but I don't waste time with their worldwide list, and instead
drill down into one of their country sub-pools.

The NTP service in Windows only polls at specific events: when you log
into your Windows account, and about a week between. It is possible,
like with heavy video editing, that the system clock gets off too much
(which can affect SSL/TLS connects that have a timestamp in their
handshaking tokens). There is a difference between the RTC (hardware
clock) and the system (Windows clock). Windows reads the RTC on its
startup, but if you leave your computer running 24x7 then it doesn't
read the RTC thereafter. The RTC clock is dependent on the CMOS battery
for power to keep it running when you power off your computer. If it
becomes weak or dead, the RTC will drift or reset (I'd have to look up
the base time, but it's like many years ago within a 100-year sliding
window).

If you want to only once force and NTP update, and thereafter let the
NTP service in Windows do the time sync but at its rather length polling
intervals, use the control panel wizard mentioned above to go to its
Internet Time tab, Change Settings button, and click Update Now. If you
want to change the polling interval of Windows Time service, that's a
registry setting that I'd have to look up again for a data item defined
under:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

If you want your system time updated more often, you can edit the
registry to shorten the poll interval. Rather than go through that
training curve and registry editing, I just created an event in Task
Schedule (give whatever name you like) with multiple triggers:

Name: Time sync (force)

Trigger 1: 12:05 AM every day
Trigger 2: At startup
Trigger 3: On workstation unlock of any user

I could define an hourly trigger, but my Windows system clock doesn't
drift far enough to be concern about how off it gets within a day. I
rarely power down my PC, but I still add an "at startup" event whenever
I do reboot the computer. The time gets sync everytime my PC gets
unlocked. I have the screen saver configured to lock the screen after a
while, so when I unlock it a time sync gets forced. You can pick
whatever event types and how to define them that you like. They all run
the same time sync tool: w32tm.exe. You can see what arguments it takes
by running "w32tm /?" in a command shell.

Command: cmd.exe /c start /min c:\batch\timesync.bat

I use a batch file to run w32tm.exe, because I want to ensure the time
sync service is running when I ask it to force an update. In short, it
runs the following commands:

net start w32time
w32tm /resync /nowait

That will flash a console window on the screen for the command shell
(cmd.exe), but the /min argument to the internal 'start' command (inside
of cmd.exe) minimizes the window to a taskbar button, so you might see
the button flash on the taskbar, but you'll need to be focused on the
taskbar at the time the scheduled event triggers.

net is an asychronous command. It issues a start request to the
service. If the service is already running, the request is ignored. If
the service isn't ready by the time the following w32tm.exe command is
executed, well, it will be by the time one of the scheduled events next
triggers. No point in repeatedly running w32tm.exe if the W32TIME
service isn't running.

The scheduled event runs under the SYSTEM account. It is necessary to
have system privileges to get w32tm.exe to work.

By the way, the Time Service can get screwed up, and here's an article
on fixing that:

https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/specialpollinterval-polling-interval-time-service-not-correct

Also check you can do the manual Update Now previously mentioned. In
addition, go into service controller (services.msc), and check the state
of the Windows Time (W32TIME) service. It should be set to Manual
trigger mode (a program calls it when needed) and state is RUNNING. If
it is not running, right-click on it and select Start. If you get an
error that the service won't start, that requires some troubleshooting
we'll look into later if needed. If the service has been disabled,
right-click on it, Properties, and change Startup Type from Disabled to
Manual.

There are lots of NTP clients to do the time sync on whatever events
they can define (most are just scheduled by time and load as background
programs instead of as a service). Search on "windows atomic clock". I
used to use SocketWatch, it went dead, I had to keep updating its NTP
servers list because some disappear after a while, and new ones show up.
I decided to use the time sync service already provided in Windows, and
learned how to tweak it. Overall, it isn't much more difficult than
having to configure (and possibly reconfigure) an NTP client you run
instead. No need to use 3rd-party software when Windows already has its
own NTP client.

I've never heard that Turnpike can be used as an NTP client, but then
I've never used Turnpike. Did its NTP (time sync) function work before?
Perhaps you are misconstruing what some "time" function of it does.
What does Turnpike's documentation or help say its "time thing" is
supposed to do? A newsreader, or some combo client, seems the wrong
place to perform NTP functions. You want to sync your Windows system
clock with an NTP server, not with an NNTP server.
J. P. Gilliver
2023-07-25 02:06:07 UTC
Permalink
Post by VanguardLH
Post by J. P. Gilliver
Turnpike - a news/email client (well, I suppose you'd call it a suite,
as it includes various other things, like ping, finger, telnet,
traceroute, and the time thing; I mainly use only the news and email
parts). Ceased development 2007. But the question was general. (TP
checks [and tries to correct] the time on connecting, and at settable
intervals - I have it set to 24h, which I think is the default.)
But NTP (Network Time Protocol) servers are not NNTP servers. Wrong
place to get the time. Just like clients, NNTP servers can have the
wrong time until you notify the owner of the discrepancy.
Indeed. I'm not after ultra-precision anyway - just the clock on my
system (whether the software or hardware I'm not sure: probably the
software one, as I leave the machine on for weeks on end) loses
somewhat.
[]
Post by VanguardLH
You edit the registry to add more NTP servers to the list you see in the
timedate.cpl wizard under its Internet Time tab and Change Settings
I remembered it was something like that, though that wasn't my question.
(I _think_ you can manually enter the server in Turnpike; since the one
it's currently set to returns something, I'm not worried.)

[Long and informative VanguardLH issue kept for reference (though I
doubt I ever _will_ refer to it!).]
Post by VanguardLH
I've never heard that Turnpike can be used as an NTP client, but then
I've never used Turnpike. Did its NTP (time sync) function work before?
I'm not sure. It certainly did in earlier versions of Windows - not sure
about XP, but certainly '9x. (Turnpike's been around a LONG time, and I
suspect this part never touched!) It _seemed_ to work on my previous W7
machine, but it's possible I had the built-in one enabled (I think it is
by default) and never noticed the TP one wasn't working.
Post by VanguardLH
Perhaps you are misconstruing what some "time" function of it does.
From its log window: "SNTP: PC clock corrected (it was 42 seconds
slow)". So I think I've got OK what it does! Or rather, is supposed to
do; this thread was triggered by my retriggering that function, and
getting the same message ("it was 42 seconds slow") each time.
Post by VanguardLH
What does Turnpike's documentation or help say its "time thing" is
supposed to do? A newsreader, or some combo client, seems the wrong
place to perform NTP functions. You want to sync your Windows system
clock with an NTP server, not with an NNTP server.
I've no idea what SNTP is. But the rest of the report suggests it's
trying to do what I think it is trying to do.

If I go into "Configure | Time Synchronisation", there is a window to
enter the name of the "Time server", and two button choices: one
"Protocol", where I choose either SNTP or TIME, and one for
"Automatically correct the PC clock", where I choose Never, By up to 80
minutes, or Always (I have the middle one selected, which is the default
- allows for summer/winter time shift I think - possibly left over from
before that was part of Windows!). Ok, and there's a tickbox, and "When
connected, synchronise the time every [] hours and [] minutes", which is
currently at (default I think) 24 0.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Norman Tebbitt has the irritating quality of being much nicer in person than
he is in print. - Clive Anderson, RT 1996/10/12-18
VanguardLH
2023-07-25 03:38:19 UTC
Permalink
Post by J. P. Gilliver
I've no idea what SNTP is. But the rest of the report suggests it's
trying to do what I think it is trying to do.
https://www.meinbergglobal.com/english/faq/faq_37.htm
https://www.galsys.co.uk/news/what-the-difference-between-ntp-and-sntp/

One difference is SNTP just takes the time from the server, and the
client sets its OS system clock to that value. NTP adds some smoothing
(skewing) to the adjustment (drift) to eliminate exaggerated
compensation.

How far different is the NTP server from your OS system clock? An hour?
As I recall, SocketWatch had an option to bypass an adjustment if the OS
clock and NTP server were off by more than an hour.

SocketWatch, as with other atomic clock tools, must be ran with
administrator privileges, or you need to disable UAC (User Access
Control) in Windows. When you run Turnpike, is it running inside a
command shell with elevated privileges?

UAC was added to Windows Vista, and later (so Win7 is included);
however, to me, running Turnpike as admin is probably not a smart idea
for that type of user-mode client. A lot of users were accustomed to
doing anything they want whenever they wanted without interference or
interruption by the OS for security purposes, even for accidental
screwups, and didn't care about throttling malware or rogue or
overreaching programs. They complained about UAC elevation prompts when
it showed up in Windows Vista, but Windows 7 was far more adopted when
migrating from Windows XP.

https://learn.microsoft.com/en-us/windows/security/application-security/application-control/user-account-control/how-it-works
https://en.wikipedia.org/wiki/User_Account_Control

How long have you been running Windows 7? Most users hit the UAC prompt
soon after starting to use it. Open the Start menu and search on "UAC"
or "User access control". Or run wscui.cpl, and select "Change User
Account Control settings". You can see the different settings for UAC,
but you must be logged into a Windows account with Administrator
privileges to change the UAC level.

https://support.microsoft.com/en-au/topic/guided-help-adjust-user-account-control-settings-in-windows-7-and-windows-8-605f891d-42c5-2b93-4b4b-e4c5d4d35f60
J. P. Gilliver
2023-07-25 09:16:45 UTC
Permalink
In message <***@v.nguard.lh> at Mon, 24 Jul 2023 22:38:19,
VanguardLH <***@nguard.LH> writes
[]
Post by VanguardLH
How far different is the NTP server from your OS system clock? An hour?
I think 42 seconds is the biggest difference I've seen so far.
Post by VanguardLH
As I recall, SocketWatch had an option to bypass an adjustment if the OS
clock and NTP server were off by more than an hour.
Turnpike has a choice of correct the clock Never, By up to 80 minutes,
Always. I _think_ the 80 minute limit was to allow for summer/winter
time switching - TP I _think_ preceded that being automatically part of
windows (but I could be wrong about that). Help | About shows Copyright
1995-2007.
Post by VanguardLH
SocketWatch, as with other atomic clock tools, must be ran with
administrator privileges, or you need to disable UAC (User Access
Control) in Windows. When you run Turnpike, is it running inside a
command shell with elevated privileges?
Not that I remember. I do remember that at install time, if on (I think)
XP or later, we had to run a couple of (I think) CLSID commands to give
it a certain sort of control over a couple of directories if we
installed it in certain places on C: (which it defaulted to).
Post by VanguardLH
UAC was added to Windows Vista, and later (so Win7 is included);
however, to me, running Turnpike as admin is probably not a smart idea
for that type of user-mode client. A lot of users were accustomed to
doing anything they want whenever they wanted without interference or
interruption by the OS for security purposes, even for accidental
screwups, and didn't care about throttling malware or rogue or
overreaching programs. They complained about UAC elevation prompts when
it showed up in Windows Vista, but Windows 7 was far more adopted when
migrating from Windows XP.
I never had Vista. I think I have left 7 at the default level - I do
occasionally get a do you want to allow popup, and like to see them:
they're not common enough to be a problem.
[]
Post by VanguardLH
How long have you been running Windows 7? Most users hit the UAC prompt
Some years; some months on this machine.
[]
Next time I start it, I may - if I remember! - try doing it with
elevated privileges, just to see if it can change the clock, and then
close it.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

...Every morning is the dawn of a new error...
VanguardLH
2023-07-25 17:12:56 UTC
Permalink
Post by J. P. Gilliver
I do remember that at install time, if on (I think)
XP or later, we had to run a couple of (I think) CLSID commands to give
it a certain sort of control over a couple of directories if we
installed it in certain places on C: (which it defaulted to).
Did you install TP in one of the C:\Program Files [x86] folders? Those
became protected folders. It became a no-no for programs to write data
into their own program folder. They were supposed to write their data
under the %Appdata% folder in a subfolder for the program. ACLs (Access
Control Lists) are set on those folders to prevent write access to
processes without administrative privileges. This low-level protection
helps prevent malicious programs from modifying other programs, and
prevents non-admin users from installing non-trusted programs.

https://en.wikipedia.org/wiki/Access-control_list
https://learn.microsoft.com/en-us/windows-hardware/drivers/ifs/access-control-list

For example, I use an ancient newsreader called 40tude Dialog. I didn't
need to to run with admin privs, so I dumped it in a non-protected
folder. To "install" it, I created a C:\Programs folder under which I
created a subfolder called Dialog, and where I put the files for the
program, so I have C:\Programs\Dialog as the program folder.

However, I wouldn't think TP would be doing any writes just to issue an
NTP request. That's a sync, not a write. I would first try to run the
already-installed TP with elevated privileges. You can specify that
using a shortcut where in its properties under Shortcut tab -> Advanced
you enable the "Run as administrator" option. If you're not using a
shortcut, load the command shell with elevated privileges, and navigate
to and run the .exe program for TP.

Come back to say if elevating privileges for TP resolves the problem.
VanguardLH
2023-07-25 17:26:12 UTC
Permalink
Hmm, just another thought. Are you logging your computer into a domain
(Active Directory Domain Services)? The PDC (Primary Domain Controller)
gets used to time sync all of its workstations. Windows on the
workstations will sync with the time of the PDC as their primary NTP
server. If the PDC server is always off by, say, the 47 seconds you
mention after TP trys an NTP sync, could be the PDC time service is off
by that much. You sync using TP to a specified NTP server, but Windows
syncs to the PDC server. It is up to the PDC server to sync to an
authoritative time source, and the workstations sync to the PDC server.

I'd also check the Windows Firewall. NTP requires using UDP on port 123
to connect to an NTP server. Microsoft wouldn't have defined a blocking
rule in the Firewall against their own NTP service, but maybe there's a
rule in the Firewall against Turnpike.
J. P. Gilliver
2023-07-25 20:34:00 UTC
Permalink
Post by VanguardLH
Hmm, just another thought. Are you logging your computer into a domain
(Active Directory Domain Services)? The PDC (Primary Domain Controller)
Not knowingly. There is one box connected to the 'phone line - what UK
ISPs call a "router", which is in practice combined MoDem, router, hub,
and wifi - and one device connected to the wifi, this laptop.
Post by VanguardLH
gets used to time sync all of its workstations. Windows on the
workstations will sync with the time of the PDC as their primary NTP
server. If the PDC server is always off by, say, the 47 seconds you
mention after TP trys an NTP sync, could be the PDC time service is off
by that much. You sync using TP to a specified NTP server, but Windows
syncs to the PDC server. It is up to the PDC server to sync to an
authoritative time source, and the workstations sync to the PDC server.
Starting Turnpike's Connect with admin privileges let it correct the
clock.
Post by VanguardLH
I'd also check the Windows Firewall. NTP requires using UDP on port 123
to connect to an NTP server. Microsoft wouldn't have defined a blocking
rule in the Firewall against their own NTP service, but maybe there's a
rule in the Firewall against Turnpike.
It was connecting to the time server no problem - it knew how far out
the local clock was; it just was unable to correct it.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Never make the same mistake twice...there are so many new ones to make!
J. P. Gilliver
2023-07-25 20:29:37 UTC
Permalink
Post by VanguardLH
Post by J. P. Gilliver
I do remember that at install time, if on (I think)
XP or later, we had to run a couple of (I think) CLSID commands to give
it a certain sort of control over a couple of directories if we
installed it in certain places on C: (which it defaulted to).
Did you install TP in one of the C:\Program Files [x86] folders? Those
Not this time. (No x86 folder - this being a 32-bit system, _all_ are
32-bit, and when that's the case, the system doesn't _make_ two such
folders.) This time, since Turnpike is so small relative to other
things, I installed it entirely on D:, so that it gets backed up with my
normal data backup. (It's the only software I've done that with.)
[]
Post by VanguardLH
However, I wouldn't think TP would be doing any writes just to issue an
NTP request. That's a sync, not a write. I would first try to run the
already-installed TP with elevated privileges. You can specify that
using a shortcut where in its properties under Shortcut tab -> Advanced
you enable the "Run as administrator" option. If you're not using a
shortcut, load the command shell with elevated privileges, and navigate
to and run the .exe program for TP.
Speaking to you now, having started the Connect part of TP with Run as
administrator ...
Post by VanguardLH
Come back to say if elevating privileges for TP resolves the problem.
... and it did indeed really correct the clock when it said it was doing
so. So if I'm ever worried about it in future, I know what to do.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Never make the same mistake twice...there are so many new ones to make!
Char Jackson
2023-07-26 01:15:07 UTC
Permalink
Post by J. P. Gilliver
Post by VanguardLH
Post by J. P. Gilliver
I do remember that at install time, if on (I think)
XP or later, we had to run a couple of (I think) CLSID commands to give
it a certain sort of control over a couple of directories if we
installed it in certain places on C: (which it defaulted to).
Did you install TP in one of the C:\Program Files [x86] folders? Those
Not this time. (No x86 folder - this being a 32-bit system, _all_ are
32-bit, and when that's the case, the system doesn't _make_ two such
folders.) This time, since Turnpike is so small relative to other
things, I installed it entirely on D:, so that it gets backed up with my
normal data backup. (It's the only software I've done that with.)
[]
Post by VanguardLH
However, I wouldn't think TP would be doing any writes just to issue an
NTP request. That's a sync, not a write. I would first try to run the
already-installed TP with elevated privileges. You can specify that
using a shortcut where in its properties under Shortcut tab -> Advanced
you enable the "Run as administrator" option. If you're not using a
shortcut, load the command shell with elevated privileges, and navigate
to and run the .exe program for TP.
Speaking to you now, having started the Connect part of TP with Run as
administrator ...
Post by VanguardLH
Come back to say if elevating privileges for TP resolves the problem.
... and it did indeed really correct the clock when it said it was doing
so. So if I'm ever worried about it in future, I know what to do.
Excellent, because I wasn't able to spend enough time with TP to figure out how
to use the darned thing. :)
John Hall
2023-07-25 09:05:07 UTC
Permalink
In message <$CeJIlxP4yvkFw1+@255soft.uk>, J. P. Gilliver
<***@255soft.uk> writes
<sanip>
Post by J. P. Gilliver
If I go into "Configure | Time Synchronisation", there is a window to
enter the name of the "Time server", and two button choices: one
"Protocol", where I choose either SNTP or TIME, and one for
"Automatically correct the PC clock", where I choose Never, By up to 80
minutes, or Always (I have the middle one selected, which is the
default - allows for summer/winter time shift I think - possibly left
over from before that was part of Windows!). Ok, and there's a tickbox,
and "When connected, synchronise the time every [] hours and []
minutes", which is currently at (default I think) 24 0.
You could try selecting Always and see if it makes any difference.
Though it seems unlikely, it's just possible that the check for "By up
to 80 minutes" is somehow screwing things up.
--
John Hall "[It was] so steep that at intervals the street broke into steps,
like a person breaking into giggles or hiccups, and then resumed
its sober climb, until it had another fit of steps."
Ursula K Le Guin "The Beginning Place"
J. P. Gilliver
2023-07-25 09:23:28 UTC
Permalink
In message <***@jhall_nospamxx.co.uk> at Tue, 25 Jul 2023
10:05:07, John Hall <***@jhall.co.uk> writes
[]
Post by John Hall
You could try selecting Always and see if it makes any difference.
Though it seems unlikely, it's just possible that the check for "By up
to 80 minutes" is somehow screwing things up.
Good lateral thinking! I just tried it (having manually set the clock
far enough fast - over a minute - that I could see the result if any),
and no, it didn't change it.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

...Every morning is the dawn of a new error...
Java Jive
2023-07-25 09:47:09 UTC
Permalink
Post by J. P. Gilliver
Post by J. P. Gilliver
Turnpike - a news/email client (well, I suppose you'd call it a suite,
as it includes various other things, like ping, finger, telnet,
traceroute, and the time thing; I mainly use only the news and email
parts). Ceased development 2007. But the question was general. (TP
checks [and tries to correct] the time on connecting, and at settable
intervals - I have it set to 24h, which I think is the default.)
But NTP (Network Time Protocol) servers are not NNTP servers.  Wrong
place to get the time.  Just like clients, NNTP servers can have the
wrong time until you notify the owner of the discrepancy.
Indeed. I'm not after ultra-precision anyway - just the clock on my
system (whether the software or hardware I'm not sure: probably the
software one, as I leave the machine on for weeks on end) loses somewhat.
Then either your existing time source is failing to get the correct time
and/or your RTC hardware in the BIOS is wandering, or possibly you have
some sort of malware which is affecting your existing method. The
answer to the first two is as VanguardLH suggested: do it the 'right'
way, disable your existing method and use an approved NTP server such as
uk.pool.ntp.org:

Your existing program's time setting may be started by one of several
methods:

As a service: find, stop, and disable it in Computer Management;

As a shortcut in a Startup folder: do one of ...
Delete the shortcut;
Move it to its parent program's Start Menu folder;
Create a parallel Startup Not folder and move it there.
The Startup folders are:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start
Menu\Programs\Startup

As a value in a registry Run key: Optionally, make a similar key Run
Not and copy the particular key value there, before deleting it from
Run, or rename the target exe file to have an extension of .exe.not.
The keys to examine are ...
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Run
... though the last Run key is rare and may not even be defined.

To set your W7 to use internet time in the approved way:
Click the clock on the taskbar;
Click Change date and time settings...;
Click Internet time;
Click Change settings;
Ensure that Synchronise with an Internet time server is checked;
Enter a suitable server and click Update now;
Click Ok all the way back out.

As for malware, ISTR that there was a scare some time back that malware
either could potentially or was already hi-jacking the NTP system in
some way, and there was talk of encrypting the service, but I'm not sure
what the end result was. Certainly for years I've used NTP from
uk.pool.ntp.org with little or no problems, but you could run a scan for
rootkits and other malware using a program like MalwareBytes.
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
J. P. Gilliver
2023-07-25 10:11:41 UTC
Permalink
[]
Post by Java Jive
Post by J. P. Gilliver
Indeed. I'm not after ultra-precision anyway - just the clock on my
system (whether the software or hardware I'm not sure: probably the
software one, as I leave the machine on for weeks on end) loses somewhat.
Then either your existing time source is failing to get the correct
time and/or your RTC hardware in the BIOS is wandering, or possibly you
have some sort of malware which is affecting your existing method. The
No, you're misunderstanding me. I have two ways of ensuring the system
clock is showing the right time:

1. Windows 7's built-in way (currently not enabled)
2. Turnpike (currently thinks it's making corrections but isn't).

Both are currently set to the same time server. If I manually enable the
W7 built-in way, it _does_ successfully correct the clock, so my
"existing time source" - the time server - _is_ yielding to correct
time.
Post by Java Jive
answer to the first two is as VanguardLH suggested: do it the 'right'
way, disable your existing method and use an approved NTP server such
It's not which server I use, as both are using the same one.

Turnpike _is_ retrieving the correct time from the server, as its log
window shows the corrections it thinks it's making: it's just that it
isn't actually making them, presumably because it doesn't have the
appropriate permission to do so.
[]
Post by Java Jive
Click the clock on the taskbar;
Click Change date and time settings...;
Click Internet time;
Click Change settings;
At that point there's an "Update now" button, which allows a one-off
manual action. This is what I've been doing - see above - to verify that
the time server I am using (both shown in that window and in Turnpike)
is indeed yielding a correct time (correct enough for me, anyway).
Post by Java Jive
Ensure that Synchronise with an Internet time server is checked;
Enter a suitable server and click Update now;
Click Ok all the way back out.
Now that I come to look at that part of W7, I can't actually see any
setting for how _often_ it does a sync.; I vaguely remember that it
might be once in 24 hours. (In Turnpike, you set the interval - on mine
it's set to 24h 0m, which I think was the default.)
Post by Java Jive
As for malware, ISTR that there was a scare some time back that malware
either could potentially or was already hi-jacking the NTP system in
some way, and there was talk of encrypting the service, but I'm not
sure what the end result was. Certainly for years I've used NTP from
uk.pool.ntp.org with little or no problems, but you could run a scan
for rootkits and other malware using a program like MalwareBytes.
I don't think I have any problem - this entire thread was triggered by
my happening to notice that TP was not correcting the clock, though it
thought it was; my first thought was that it was set to use a time
server that was no longer extant (or no longer responding in the way TP
expected), but on checking, I found it was set to use the same server as
W7's built-in mechanism, which when invoked manually _did_ correct the
clock, so I deduced that TP doesn't have the right access permission.

There's another post in this thread with a link something like "how to
give prog.s access to the clock"; I'm about to read that now!
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Veni, Vidi, VO5 (I came, I saw, I washed my hair) - Mik from S+AS Limited
(***@saslimited.demon.co.uk), 1998
Java Jive
2023-07-25 12:03:29 UTC
Permalink
Post by J. P. Gilliver
Post by Java Jive
Then either your existing time source is failing to get the correct
time and/or your RTC hardware in the BIOS is wandering, or possibly
you have some sort of malware which is affecting your existing
method.  The
No, you're misunderstanding me. I have two ways of ensuring the system
1. Windows 7's built-in way (currently not enabled)
2. Turnpike (currently thinks it's making corrections but isn't).
Both are currently set to the same time server. If I manually enable the
W7 built-in way, it _does_ successfully correct the clock, so my
"existing time source" - the time server - _is_ yielding to correct time.
So do it the W7 built-in way and have done with the, er, time-wasting,
problem!
Post by J. P. Gilliver
Post by Java Jive
answer to the first two is as VanguardLH suggested: do it the 'right'
way, disable your existing method and use an approved NTP server such
It's not which server I use, as both are using the same one.
Turnpike _is_ retrieving the correct time from the server, as its log
window shows the corrections it thinks it's making: it's just that it
isn't actually making them, presumably because it doesn't have the
appropriate permission to do so.
But, as it's failing, do it the approved way, instead.
Post by J. P. Gilliver
Post by Java Jive
      Click the clock on the taskbar;
      Click Change date and time settings...;
      Click Internet time;
      Click Change settings;
At that point there's an "Update now" button, which allows a one-off
manual action. This is what I've been doing - see above - to verify that
the time server I am using (both shown in that window and in Turnpike)
is indeed yielding a correct time (correct enough for me, anyway).
Post by Java Jive
      Ensure that Synchronise with an Internet time server is checked;
      Enter a suitable server and click Update now;
      Click Ok all the way back out.
Now that I come to look at that part of W7, I can't actually see any
setting for how _often_ it does a sync.; I vaguely remember that it
might be once in 24 hours. (In Turnpike, you set the interval - on mine
it's set to 24h 0m, which I think was the default.)
As long as it's at least once every 24 hours and preferably not much
more than once an hour or so, I don't really see that's much of a
problem, few hardware clocks are going to get seriously out over less
than a day.

However, if you can decipher them, the service settings are at ...

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time

... and in particular ...

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config

... which has various settings and values, in my case, such as ...

FrequencyCorrectRate = 0x4
MaxPollInterval = 0xf
MinPollInterval = 0xa

... which may be relevant, but I think the following is probably what
you want ...

UpdateInterval = 0x57e40

... which is 360000 in real money. I'm guessing that's probably a
number of milliseconds = 6 minutes, or possibly seconds = 100 hours. An
internet search would probably find out its exact meaning, but I've
never felt the need to change anything other than the server, preferring
uk.pool.ntp.org rather than Microsoft's offering. ISTR that in XP I had
to change the server under the above registry key, but in W7 you can do
it just via the GUI.
Post by J. P. Gilliver
Post by Java Jive
As for malware, ISTR that there was a scare some time back that
malware either could potentially or was already hi-jacking the NTP
system in some way, and there was talk of encrypting the service, but
I'm not sure what the end result was.  Certainly for years I've used
NTP from uk.pool.ntp.org with little or no problems, but you could run
a scan for rootkits and other malware using a program like MalwareBytes.
I don't think I have any problem - this entire thread was triggered by
my happening to notice that TP was not correcting the clock, though it
thought it was; my first thought was that it was set to use a time
server that was no longer extant (or no longer responding in the way TP
expected), but on checking, I found it was set to use the same server as
W7's built-in mechanism, which when invoked manually _did_ correct the
clock, so I deduced that TP doesn't have the right access permission.
There's another post in this thread with a link something like "how to
give prog.s access to the clock"; I'm about to read that now!
FFS, why bother? Just do it the same as everyone else does it! If the
standard method didn't work for some reason, I could understand wanting
to investigate further, but in this case it's the non-standard method
that's not working, so fire it and forget it. I used to use Digiguide
to do this, but when I found that the W32Time service 'just worked', I
disable that option in the program, and have never had any desire to
re-enable it.
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
J. P. Gilliver
2023-07-25 12:37:22 UTC
Permalink
[]
Post by Java Jive
So do it the W7 built-in way and have done with the, er, time-wasting,
problem!
[]
Post by Java Jive
But, as it's failing, do it the approved way, instead.
See below re "curiosity".
[]
Post by Java Jive
As long as it's at least once every 24 hours and preferably not much
more than once an hour or so, I don't really see that's much of a
problem, few hardware clocks are going to get seriously out over less
than a day.
Agreed.
[]
Post by Java Jive
FFS, why bother? Just do it the same as everyone else does it! If the
standard method didn't work for some reason, I could understand wanting
to investigate further, but in this case it's the non-standard method
that's not working, so fire it and forget it. I used to use Digiguide
to do this, but when I found that the W32Time service 'just worked', I
disable that option in the program, and have never had any desire to
re-enable it.
I don't think _curiosity_ - which was my main reason for starting the
thread (my first post didn't mention Turnpike) - should be suppressed:
if it was, we'd never find out anything. My original question was, more
or less, "do prog.s need special permission to write-access the clock,
and if so, how is it achieved?"; that's _sort of_ been answered - at
least, the first part has (seems to be "yes they do need more permission
than they once did"), and the second may have been but is more
complicated than I'd hoped.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Sometimes I believe we made up god just to have someone to blame for our
mistakes - "Sarah Sidle" (Jorja Fox), CSI
CoMmAnDoTrOn
2023-07-25 06:30:54 UTC
Permalink
Post by J. P. Gilliver
Post by David E. Ross
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Start the old application using Run As Administrator.

Disclaimer: all advice given in this post is at your own risk.
Post by J. P. Gilliver
Post by David E. Ross
What is your "old application"?
Turnpike - a news/email client (well, I suppose you'd call it a suite,
as it includes various other things, like ping, finger, telnet,
traceroute, and the time thing; I mainly use only the news and email
parts). Ceased development 2007.
Launching anything from an application running as Administrator carries
a risk. You may find many ways to experience the risk.

Here is one easy way for you to experience the risk for yourself. Go to
alt.binaries.games.pro-vir.pc and launch the file "Roo Tyoo" from within
Turnpike, all while running Turnpike as Administrator. You do this at
your own risk.
KenW
2023-07-24 16:54:34 UTC
Permalink
On Mon, 24 Jul 2023 13:30:49 +0100, "J. P. Gilliver"
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Yes, I know W7 has its own time sync. mechanism (I think XP did too);
I'd just rather like my old application to be able to do so, for
nostalgia reasons if nothing else. FWIW, both the internal and my old
application point to the same time server. Manually invoking a
correction using W7's own mechanism _did_ result in the clock being
corrected, as you'd expect.
I use Neutron Time on Win 11. It is an old program


KenW
Char Jackson
2023-07-24 19:40:27 UTC
Permalink
On Mon, 24 Jul 2023 13:30:49 +0100, "J. P. Gilliver" <***@255soft.uk>
wrote:

I see that you've found the old demon.ip.support.turnpike newsgroup.
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
Not that I know of.
Post by J. P. Gilliver
I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Is your version of Turnpike available to download anywhere? I could toss
it into a 64-bit Win7 VM to see how it behaves.

Would be nice if there was someone else who already uses it so they
could report on how it works for them WRT time sync.

Last question, does Turnpike just give you a button that's supposed to
launch an external time sync program, or is it completely built into the
program itself?

Which time server are you using? You said it's the same one you use in
Windows itself, but which one is that?
J. P. Gilliver
2023-07-25 02:18:43 UTC
Permalink
Post by Char Jackson
I see that you've found the old demon.ip.support.turnpike newsgroup.
I've been a DIST subscriber for a long time! I actually asked this there
first, and one of the others suggested I ask here, initially not
mentioning Turnpike, so I did that.
Post by Char Jackson
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
Not that I know of.
Post by J. P. Gilliver
I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Is your version of Turnpike available to download anywhere? I could toss
it into a 64-bit Win7 VM to see how it behaves.
https://www.jaytag.co.uk/blog/turnpike-six-v6-07-entire-exe-download -
but it won't run on 64-bit OSs. (It did on pre-release versions of 7-64,
but not on the final release version: Microsoft removed some
backwards-compatible aspect.) Actually, I think the "Connect" part may
still work - the news and mail part was written as a shell extension
(mailboxes and newsgroups appear as folders), which I never thought was
a good idea. (Apparently earlier versions - v5 and previous - which
didn't have that "feature" - _do_ run in 64OSs, but that's seriously old
and probably has other reasons not to go back to it.)
Post by Char Jackson
Would be nice if there was someone else who already uses it so they
could report on how it works for them WRT time sync.
That's why I asked in DIST first. No reply (other than the suggestion of
asking here) yet.
Post by Char Jackson
Last question, does Turnpike just give you a button that's supposed to
launch an external time sync program, or is it completely built into the
program itself?
I'm pretty sure it's built in. It was, when it first appeared, a sort of
Swiss Army knife, what with the telnet, finger, ping, trace route, and
cost monitor (when it first appeared dialup was still the norm!), and
buttons to link to (external) browser and FTP.

There isn't a button to trigger the time sync as such: it operates when
Turnpike first "connects", then at settable intervals (see my reply to
VanguardLH's post).
Post by Char Jackson
Which time server are you using? You said it's the same one you use in
Windows itself, but which one is that?
time.windows.com
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Norman Tebbitt has the irritating quality of being much nicer in person than
he is in print. - Clive Anderson, RT 1996/10/12-18
Char Jackson
2023-07-25 05:45:13 UTC
Permalink
Post by J. P. Gilliver
Post by Char Jackson
I see that you've found the old demon.ip.support.turnpike newsgroup.
I've been a DIST subscriber for a long time! I actually asked this there
first, and one of the others suggested I ask here, initially not
mentioning Turnpike, so I did that.
Yes, I saw that. :)
Post by J. P. Gilliver
Post by Char Jackson
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
Not that I know of.
Post by J. P. Gilliver
I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Is your version of Turnpike available to download anywhere? I could toss
it into a 64-bit Win7 VM to see how it behaves.
https://www.jaytag.co.uk/blog/turnpike-six-v6-07-entire-exe-download -
but it won't run on 64-bit OSs. (It did on pre-release versions of 7-64,
but not on the final release version: Microsoft removed some
backwards-compatible aspect.) Actually, I think the "Connect" part may
still work - the news and mail part was written as a shell extension
(mailboxes and newsgroups appear as folders), which I never thought was
a good idea. (Apparently earlier versions - v5 and previous - which
didn't have that "feature" - _do_ run in 64OSs, but that's seriously old
and probably has other reasons not to go back to it.)
I created a new 32-bit Windows 7 VM before downloading and installing
the Turnpike package linked above. Ugh! LOL Is there a connection
setting that's just a generic network connection, without requiring me
to specify a dial-up destination? I haven't had dial-up since the late
1990s so I'm not sure what to select from the service list.

I have to say that my patience is quite thin at the moment. This program
is *SO* non-standard that it makes my head hurt. You're used to it, I
know.

<snip>
J. P. Gilliver
2023-07-25 09:51:40 UTC
Permalink
[]
Post by Char Jackson
Post by J. P. Gilliver
Post by Char Jackson
Is your version of Turnpike available to download anywhere? I could toss
it into a 64-bit Win7 VM to see how it behaves.
https://www.jaytag.co.uk/blog/turnpike-six-v6-07-entire-exe-download -
but it won't run on 64-bit OSs. (It did on pre-release versions of 7-64,
[]
Post by Char Jackson
I created a new 32-bit Windows 7 VM before downloading and installing
the Turnpike package linked above. Ugh! LOL Is there a connection
Wow! You're expending a lot of effort for my little query! I certainly
wasn't expecting anyone to do that.
Post by Char Jackson
setting that's just a generic network connection, without requiring me
to specify a dial-up destination? I haven't had dial-up since the late
1990s so I'm not sure what to select from the service list.
IIRR the setting to use is something like "use existing connection". (I
suspect most of the pre-coded ISPs - with their server names [and 'phone
numbers?] - no longer work!)
Post by Char Jackson
I have to say that my patience is quite thin at the moment. This program
is *SO* non-standard that it makes my head hurt. You're used to it, I
know.
<snip>
I appreciate that! (You'd hate the genealogy prog. I use - Brother's
Keeper - then; talk about non-standard. Although BK has not changed -
it's just that so many things about how Windows works _have_ changed
since BK started that it's now very quirky, as we've - mostly
unconsciously - adapted to the Windows changes. Even things like what is
normally highlighted when you tab between fields.)

There's a further wrinkle with Turnpike, which I really don't want you
to expend further time on! It was (eventually) free for users of Demon
Internet, but to use it with other providers, you had to buy and enter a
key; the as-installed version above gives something like 6.07S, and
entering the key turns it into 6.07M. How it actually implemented the
check - if you were running the free version - was to have an exchange
with a server, hard-coded into it (it wouldn't proceed beyond some point
if it didn't receive the appropriate response from that server);
needless to say, eventually, Demon (or it's inheritor - it passed
through various companies - I think Cable and Wireless, Thus, and
eventually Vodafone) turned off that server (many years ago now!).
Turnpike enthusiasts found a way round this - I can't remember whether
it was before the turnoff, so that people could use the free version
with other ISPs, or just after so that existing ex-Demon users could
continue to use their Turnpike with Demon (or what it had become).
Initially, one very kind user set up a server to mimic the Demon one,
and users just had to add a line to their hosts file; eventually someone
(not sure if the same someone) produced a version of the "server" which
could be run locally (so the hosts file line was amended to point
inwards). [The person running the mimic server said - I think within the
last year or two! - that he was still getting a few accesses to it!]

I'm not sure if the S version would get as far as trying time server
access without that patch, but anyway, I don't want you to try your
patience further, just for a minor curiosity like this! (There's another
post in this thread that has a link to something about letting prog.s
have access to the clock, which I haven't followed yet.) If you really
_do_ want to pursue a Turnpike installation further I'll see if I can
dig out details of the patch (or give you my key [its antipiracy
mechanism means two users of the same key couldn't email each other, but
I doubt you'd be making it your main email client somehow!]), but I
don't think you want to go that far! (And if you do, we'd maybe better
go to DIST.)

John
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

...Every morning is the dawn of a new error...
John Hall
2023-07-25 09:22:12 UTC
Permalink
Post by Char Jackson
I see that you've found the old demon.ip.support.turnpike newsgroup.
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
Not that I know of.
Post by J. P. Gilliver
I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Is your version of Turnpike available to download anywhere? I could toss
it into a 64-bit Win7 VM to see how it behaves.
Unfortunately it's 32-bit only. That's because the developers integrated
it with File Manager, and back then Windows was 32-bit only. When 64-bit
Windows came in, Microsoft changed File Manager in some way that meant
it was no longer compatible. Unfortunately by then Turnpike was no
longer being supported and its developer tam had been disbanded.
Post by Char Jackson
Would be nice if there was someone else who already uses it so they
could report on how it works for them WRT time sync.
I'm using it under 32-bit Windows 10, where it runs fine. Looking at my
current logging file, I see:

Tue, 25 Jul 2023 09:38:09 SNTP: PC clock corrected (it was 1 seconds
slow)

Being old-fashioned, I always turn off my PC overnight, and start it
again each morning - when I think Windows resets the clock if necessary
- so I imagine there's never a chance for a big time discrepancy to
build up.
Post by Char Jackson
Last question, does Turnpike just give you a button that's supposed to
launch an external time sync program, or is it completely built into the
program itself?
AIUI, the check with an external time server is built into TP itself.
Post by Char Jackson
Which time server are you using? You said it's the same one you use in
Windows itself, but which one is that?
It don't know which one the other John uses, but in Turnpike I'm using
139.143.5.31. I can't remember which server that is. (One enters the
dotted quad address to avoid the possibly unpredictable time delay
caused by a DNS look-up.)
--
John Hall "[It was] so steep that at intervals the street broke into steps,
like a person breaking into giggles or hiccups, and then resumed
its sober climb, until it had another fit of steps."
Ursula K Le Guin "The Beginning Place"
Paul
2023-07-25 11:09:50 UTC
Permalink
Tue, 25 Jul 2023 09:38:09 SNTP: PC clock corrected (it was 1 seconds slow)
Being old-fashioned, I always turn off my PC overnight, and start it again each morning - when
I think Windows resets the clock if necessary - so I imagine there's never a chance for a
big time discrepancy to build up.
Just for the record, on occasion, the "big" NTP references like time.windows.com
can be off by *20 minutes* :-) So if you think life owes you a free lunch, it is
a lunch of a quite variable quality :-) I was pretty shocked the time that happened
to me (picked up a bad update). I switched references, did another update, and
brought it back.

https://nist.time.gov/

"Your clock is off by +0.406 seconds" <=== my clock, now maintained only by "w32time" builtin.
Paying attention to this, is only when we have
"hold my beer" contests.

When an application checks the OS ("software clock"), more
digits are available on the software clock, than on the
RTC battery-backed clock. The RTC has a resolution of 1 second.

That's why this output from you, really annoys me.

PC clock corrected (it was 1 seconds slow)
^^^^^^^^^

This means the clever clever kiddy programmers are reading
the God damn RTC from Windows level, and making corrections
to the RTC ? When the OS is maintaining the time while the OS
is running ? The OS reads the RTC *once* at bootup, and if
left undisturbed, the OS (via w32time) may make one write to
the RTC at shutdown.

A clever clever programmer, could modify only the OS clock. Since
the OS clock has all those extra digits, the software (as if it
was NTPD) could dribble out fractional-second corrections as a
"first order correction". This is a linear fit to what is going on,
and the software concludes "this OS clock gains 0.512 seconds per hour",
and it could make a 0.128 second correction to the time, every
fifteen minutes. You could subtract 0.128 from the current OS time,
because the OS has the digits for it. To correct the RTC that way,
you would be subtracting 0.128 seconds, from a hardware device where
the lowest unit of resolution is 1 second.

When you get to the end of the day, at that point, you save out
the RTC value if necessary. I don't know what triggers that, or
whether the practice is to update it at every chance. Since the
device is just "registers", it costs nothing to update it. No
Flash memory is worn out by RTC correction. The only reason we
do not give "hardware love" to the thing, is the register interface
is quite slow, and just writing to the clock takes time. Reading the
RTC is similarly on the slow hardware bus.

But this Turnpike practice is sounding as "hoaky as a $3 bill" (a currency that does not exist).
It's a 1995 solution, in the year 2023.

The "w32time" software the OS comes with, as far as I know, it
does not make first order (dribbling) corrections. The Meinberg
software is a slightly more complete NTP-service implementation, and
it has lots more options for clock discipline. For example, by
telling it "which serial port" my GPS was on, it would
absorb GPS messages, track and correct the time as it found it.
The trick there, is the GPS has a hardware 1PPS "pulse" signal,
and if the user ties that to RI ("Ring Indicator") on the serial
port, the Meinberg software uses the edge of that pulse as the
time reference. That can give quite-good alignment. A GPS-disciplined
PC can even be used as a low-stratum reference for the rest of the
computer room (tie GPS to computer #1, sync computer #2 to computer #1).

Oscillator performance is subject to "drift" and this is a wobbly
phenomenon. A first-order correction is childs play (and it exists
as acknowledgement that no attempt was made to tune the hardware
oscillator on the motherboard). Higher order corrections are not
really going to work, because the oscillator was not designed for
any notion of stability (coefficients matched and negated by
component selection). If you want to see thoughtful implementations
of time pieces, some automobiles have had wonderful work done, with
low drift over a one year period. And that's with no "GPS tricks
to fake it". Just a decent low drift oscillator (which does not draw
a lot of power). My previous car, the car clock was the best time
piece I owned (short of the GPS of course, which is cheating).

Paul
J. P. Gilliver
2023-07-25 11:57:18 UTC
Permalink
Post by Paul
Post by John Hall
I'm using it under 32-bit Windows 10, where it runs fine. Looking at
Tue, 25 Jul 2023 09:38:09 SNTP: PC clock corrected (it was 1 seconds slow)
Being old-fashioned, I always turn off my PC overnight, and start it
again each morning - when
I think Windows resets the clock if necessary - so I imagine there's never a chance for a
big time discrepancy to build up.
Just for the record, on occasion, the "big" NTP references like
time.windows.com
can be off by *20 minutes* :-) So if you think life owes you a free lunch, it is
a lunch of a quite variable quality :-) I was pretty shocked the time that happened
to me (picked up a bad update). I switched references, did another update, and
brought it back.
https://nist.time.gov/
As another has pointed out, using an alpha rather than numeric address
adds a DNS lookup delay to the round trip (but of course has the
advantage that it doesn't need to be updated if the numeric address
changes).

(I'm not bothered by that sort of error; within two or three seconds is
more than accurate enough for me!)
Post by Paul
"Your clock is off by +0.406 seconds" <=== my clock, now
maintained only by "w32time" builtin.
Paying attention to
this, is only when we have
"hold my beer" contests.
When an application checks the OS ("software clock"), more
digits are available on the software clock, than on the
RTC battery-backed clock. The RTC has a resolution of 1 second.
That's why this output from you, really annoys me.
PC clock corrected (it was 1 seconds slow)
^^^^^^^^^
This means the clever clever kiddy programmers are reading
the God damn RTC from Windows level, and making corrections
to the RTC ? When the OS is maintaining the time while the OS
is running ? The OS reads the RTC *once* at bootup, and if
left undisturbed, the OS (via w32time) may make one write to
the RTC at shutdown.
I don't know which clock Turnpike corrects; since, under normal
circumstances, as you say the RTC is copied from the OS clock in a
normal shutdown, I would hope that it modifies the OS one, otherwise any
correction made will be lost at next shutdown. (Or, that it modifies
both, but since it says clock singular, I presume it only modifies one
of them.)
Post by Paul
A clever clever programmer, could modify only the OS clock. Since
Actually, see the above paragraph, there might be an argument for doing
exactly that. Depends whether the normal shutdown process _does_ copy
the OS clock to the RTC or not; I have a feeling it does, but CBA to
Post by Paul
the OS clock has all those extra digits, the software (as if it
was NTPD) could dribble out fractional-second corrections as a
"first order correction". This is a linear fit to what is going on,
If by "clever clever kiddy programmer" you're referring to the Turnpike
programmers, I've never seen it report fractional corrections - always a
whole number of seconds. (Also, it sometimes just says the clock was
correct, which suggests it's only using whole seconds - I presume if
fractions are involved, it would never be "correct".)
Post by Paul
and the software concludes "this OS clock gains 0.512 seconds per hour",
and it could make a 0.128 second correction to the time, every
fifteen minutes. You could subtract 0.128 from the current OS time,
because the OS has the digits for it. To correct the RTC that way,
you would be subtracting 0.128 seconds, from a hardware device where
the lowest unit of resolution is 1 second.
TP certainly doesn't do any sort of rate assessment - it just checks
against an external server at predefined intervals (24h by default, I
think). Much as I think the W7 built-in routine does. (If you adjust the
clock using the built-in facility - either by clicking "Update now" or
manually setting the time - does that also instigate a write to the RTC,
or only the OS one? Just curious.)
[]
Post by Paul
But this Turnpike practice is sounding as "hoaky as a $3 bill" (a
currency that does not exist).
It's a 1995 solution, in the year 2023.
Eh? Which practice? AFAICS, Turnpike is only doing the same as the
built-in mechanism - or rather thinks it is, but isn't, presumably for
an access permission reason.
Post by Paul
The "w32time" software the OS comes with, as far as I know, it
does not make first order (dribbling) corrections. The Meinberg
If by that you mean tweaking the entirely-software clock (doing the
software equivalent of making a mechanical adjustment to a mechanical
clock), I can see no point in doing so, since badly-behaved software
(and possibly hardware) could adversely affect it anyway. The
time-retaining software would have to have higher priority than
absolutely everything else for that to be untrue, and I don't think it
does.
Post by Paul
software is a slightly more complete NTP-service implementation, and
it has lots more options for clock discipline. For example, by
telling it "which serial port" my GPS was on, it would
absorb GPS messages, track and correct the time as it found it.
The trick there, is the GPS has a hardware 1PPS "pulse" signal,
and if the user ties that to RI ("Ring Indicator") on the serial
port, the Meinberg software uses the edge of that pulse as the
time reference. That can give quite-good alignment. A GPS-disciplined
PC can even be used as a low-stratum reference for the rest of the
computer room (tie GPS to computer #1, sync computer #2 to computer #1).
That sounds like it's for users who need supreme accuracy, for perhaps
scientific reasons.
Post by Paul
Oscillator performance is subject to "drift" and this is a wobbly
phenomenon. A first-order correction is childs play (and it exists
as acknowledgement that no attempt was made to tune the hardware
oscillator on the motherboard). Higher order corrections are not
really going to work, because the oscillator was not designed for
any notion of stability (coefficients matched and negated by
component selection). If you want to see thoughtful implementations
of time pieces, some automobiles have had wonderful work done, with
low drift over a one year period. And that's with no "GPS tricks
to fake it". Just a decent low drift oscillator (which does not draw
a lot of power). My previous car, the car clock was the best time
piece I owned (short of the GPS of course, which is cheating).
Indeed; I worked in electronics. Cheap quartz-based oscillator modules
could be bought with an accuracy as bad as 500 ppm (I suspect that was
guaranteed, and to include all sources - variation with temperature,
ageing, and so on, and in practice they were better than that - I never
had any reason to _need_ high accuracy [I wasn't using them for
timekeeping]); normal _fairly_ cheap ones say about 50 or 100 ppm. I
_think_ you could buy - at a higher price - ones down to about 10 ppm;
for better than that, they had to be ovened, which obviously raises the
power consumption. I'm very impressed with your car one, as I can't
imagine that used an ovened crystal, as that would involve too much
power for a car system.
Post by Paul
Paul
As for my original question, whether prog.s need special permission to
write-access the clock (OS or RTC), it remains open, but with the strong
suggestion that yes, they do (which is fair enough, for anti-malware
reasons).
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Madness takes its toll. Please have exact change
[via Penny Mayes (***@pmail.net)]
Char Jackson
2023-07-25 13:51:29 UTC
Permalink
Post by J. P. Gilliver
As another has pointed out, using an alpha rather than numeric address
adds a DNS lookup delay to the round trip (but of course has the
advantage that it doesn't need to be updated if the numeric address
changes).
(I'm not bothered by that sort of error; within two or three seconds is
more than accurate enough for me!)
I don't think a DNS lookup has any bearing on the time. The DNS request is
resolved *before* the NTP request is sent to the NTP server, so it can take as
long as it likes without affecting the results.
Char Jackson
2023-07-25 13:45:58 UTC
Permalink
Post by Paul
Just for the record, on occasion, the "big" NTP references like time.windows.com
can be off by *20 minutes* :-)
I don't really see how that's possible, or I should say how it's likely, but
from where I sit time.windows.com is stratum 3, which isn't great. I like to use
stratum 1 servers, with stratum 2 servers as fallback. This is on my linux
systems. On Windows, I just configure a single stratum 1 server.

Back to the question of an NTP server being 'off', every 2-3 years we run
through a highly coordinated exercise with many of our bigger enterprise
customers where we help them account for a leap second, so I figure if being off
a full second is a big deal then I don't even know how an NTP server could be
off by minutes. Something's up with that.

# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
*132.163.96.1 .NIST. 1 u 12 64 1 39.681 9.593 0.691
69.89.207.99 .PPS. 1 u 4 64 1 56.171 0.981 1.183
73.239.145.47 42.20.202.230 2 u 10 64 1 85.096 15.279 4.982
216.229.4.69 162.254.66.243 2 u 10 64 1 37.995 9.128 0.356
74.6.168.73 98.137.249.214 2 u 8 64 1 81.820 12.945 0.316
72.30.35.88 98.139.133.62 2 u 7 64 1 64.130 6.741 1.186
185.125.190.58 86.23.195.30 2 u 6 64 1 124.289 11.507 0.927
209.51.161.238 66.220.9.122 2 u 6 64 1 40.378 2.783 0.440
216.229.0.49 128.138.140.44 2 u 5 64 1 38.514 9.727 0.468
198.30.92.2 130.207.244.240 2 u 3 64 1 49.261 9.973 0.698
168.61.215.74 25.66.230.2 3 u 2 64 1 37.977 9.746 0.550

That last entry is time.windows.com. Stratum 3, not used.
Paul
2023-07-25 15:34:56 UTC
Permalink
Post by Char Jackson
Post by Paul
Just for the record, on occasion, the "big" NTP references like time.windows.com
can be off by *20 minutes* :-)
I don't really see how that's possible, or I should say how it's likely, but
from where I sit time.windows.com is stratum 3, which isn't great. I like to use
stratum 1 servers, with stratum 2 servers as fallback. This is on my linux
systems. On Windows, I just configure a single stratum 1 server.
Back to the question of an NTP server being 'off', every 2-3 years we run
through a highly coordinated exercise with many of our bigger enterprise
customers where we help them account for a leap second, so I figure if being off
a full second is a big deal then I don't even know how an NTP server could be
off by minutes. Something's up with that.
# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
*132.163.96.1 .NIST. 1 u 12 64 1 39.681 9.593 0.691
69.89.207.99 .PPS. 1 u 4 64 1 56.171 0.981 1.183
73.239.145.47 42.20.202.230 2 u 10 64 1 85.096 15.279 4.982
216.229.4.69 162.254.66.243 2 u 10 64 1 37.995 9.128 0.356
74.6.168.73 98.137.249.214 2 u 8 64 1 81.820 12.945 0.316
72.30.35.88 98.139.133.62 2 u 7 64 1 64.130 6.741 1.186
185.125.190.58 86.23.195.30 2 u 6 64 1 124.289 11.507 0.927
209.51.161.238 66.220.9.122 2 u 6 64 1 40.378 2.783 0.440
216.229.0.49 128.138.140.44 2 u 5 64 1 38.514 9.727 0.468
198.30.92.2 130.207.244.240 2 u 3 64 1 49.261 9.973 0.698
168.61.215.74 25.66.230.2 3 u 2 64 1 37.977 9.746 0.550
That last entry is time.windows.com. Stratum 3, not used.
I swear to God, it was off by 20 minutes.

There might be a record of that somewhere.

That's the biggest time error of that type, I've
ever seen. And I was using one of the two big ones.

It wasn't pool.ntp.org because I'd stopped using them
years ago. I don't think anything, even the router,
runs off pool.ntp.org now.

*******

One of the reasons I have yet another standalone
timepiece in the room here today, is for a quick glance to
see that none of this rubbish has run off on me.

You know, one day, my faithful wrist watch (had been
sitting on the desk, not dropped on the floor, no
Coke spilled on it), the time setting inside that
thing was just blasted to hell. All I can think, is a
cosmic ray of energetic proportion hit it. The battery
is good and it's still keeping time today. There have been
no repeat incidents. You would think the geometry of
crusty old circuits like that, would make them less likely
to have events like that (more likely to be 3u CMOS inside than 5nm CMOS).
I could buy one of the digits being wrong, but every field
was altered.

Paul
Paul
2023-07-24 23:56:20 UTC
Permalink
Is there a setting that needs to be changed from its default, to allow applications to change the system time? I have an old application that periodically checks with a time server, and corrects the system time if different: its log window shows it is making a correction, but it isn't - next time it checks, its log window shows it is making the same correction (and I can see the clock is out by the amount shown).
Yes, I know W7 has its own time sync. mechanism (I think XP did too); I'd just rather like my old application to be able to do so, for nostalgia reasons if nothing else. FWIW, both the internal and my old application point to the same time server. Manually invoking a correction using W7's own mechanism _did_ result in the clock being corrected, as you'd expect.
That would be something like this.

https://www.meinbergglobal.com/english/sw/ntp.htm

I had a GPS on a serial port connected to it.
At least with that, you've got a good Stratum of
reference, and you're not badgering time.windows.com
multiple times a day. I had it set up on the WinXP machine...
until the WinXP motherboard died on me.

Connecting it to a more modern Windows machine, is not
gonna happen :-/ WinXP could be trusted to not abuse
the available "location info".

*******

Time maintenance consists of two parts:

1) BIOS clock - hardware is relatively slow to update, and only
absolutely needs to back up the software
clock value, during the shutdown sequence.
Resolution is one second (32768Hz quartz watch crystal,
divided by 32768 via ripple counter). Other timers on
the computer, can time into the microseconds.

2) Software clock - this is the clock maintained using OS clock interrupts,
It copies the BIOS clock at startup, then increments
at clock tick interrupt rate. Various other free running
timers (RDTSC) can achieve resolutions as fine as 100nsec.

When you are sitting there in Windows, you are observing
the OS software clock. A "service" running in the background,
would be powered by the SYSTEM account. I don't know if you
actually need Administrator to write to the Software Clock.
Traditionally, other OSes, their clock requires Administrator,
simply because only the Administrator is allowed to set the
clock on a "shared" machine. And Windows is considered a shared
machine where multiple accounts can be running at once.

Paul
R.Wieser
2023-07-25 05:12:34 UTC
Permalink
J,
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
Maybe this is of some use :

https://serverfault.com/questions/630177/how-do-i-give-a-program-permission-to-change-the-system-time-in-windows-7

not exactly the answer, but explains a bit about why you have trouble with
setting the time.

Regards,
Rudy Wieser
J. P. Gilliver
2023-07-25 10:24:35 UTC
Permalink
Post by R.Wieser
J,
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
https://serverfault.com/questions/630177/how-do-i-give-a-program-permiss
ion-to-change-the-system-time-in-windows-7
not exactly the answer, but explains a bit about why you have trouble with
setting the time.
Regards,
Rudy Wieser
Thanks, interesting. I particularly like the paragraph:

Anyway, you don't give permissions or access rights to programs. You
give permissions to users, who execute programs. These programs execute
in the security context of that user. The programs inherit their
security privileges from the user who executed them.

I'm sure that's only part of the story, but it's an interesting way of
looking at the matter.

Sometime I might try to run Turnpike - or the Connect part thereof -
with elevated privileges, just to see if that lets it correct the clock.
It's certainly not of any importance: I can always invoke the W7
mechanism, or for that matter just manually set the time to what my
wristwatch shows, which is more than accurate enough! (I usually check
my watch when I hear the time signal on the [analogue] radio, and note
how far out it is, so I know quite well enough for my needs what the
time is.)
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

Veni, Vidi, VO5 (I came, I saw, I washed my hair) - Mik from S+AS Limited
(***@saslimited.demon.co.uk), 1998
lisa
2023-07-25 07:55:56 UTC
Permalink
On Mon, 24 Jul 2023 13:30:49 +0100, "J. P. Gilliver"
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
the program I used ( neutron ) needs to run as admin.
Paul
2023-07-25 11:20:57 UTC
Permalink
Post by KenW
On Mon, 24 Jul 2023 13:30:49 +0100, "J. P. Gilliver"
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
the program I used ( neutron ) needs to run as admin.
This is why NTP runs as NTPD (like, a SVCHOST, a daemon,
rather than run as a Ring 3 application).

You are not supposed to be elevating everything you
run in Ring 3 to administrator. It defeats the <cough>
security model.

When a service runs, it is granted more rights than regular
programs. And it is also expected, that the developer writing
such software, takes more care to sanitize inputs, avoid
stack smashing, and whatever else. Only "safe" software
constructs should be used. (Just like, to write drivers,
you can be sent on a three month course, to learn all the
things you must not do inside a driver.)

An NTPD service, it keeps a .log , and dumps the details
of what it has done. You can change a configuration file,
to change the frequency of updates, which update sources
to use, and so on. But otherwise, a service (like "w32time"
the OS provides), it does not need direct meddling
by any mere user of the PC :-) The OS does have time maintenance,
like by default a time correction once per week, but it's not
the best possible effort a programmer could make. It's
merely "adequate" in a limited sense.

If you haven't tended to "w32time", then your Neutron program
and "w32time" could be making corrections to the time, at the
same time. When you run the Meinburg software, there's a description
of what to do about "w32time" to disable it. That is because
the Meinburg software is a direct replacement for "w32time".
They tell you stuff like this, so if you remove the Meinburg
software, you will remember to switch "w32time" back on.

Paul
lisa
2023-07-26 07:43:25 UTC
Permalink
Post by Paul
Post by KenW
On Mon, 24 Jul 2023 13:30:49 +0100, "J. P. Gilliver"
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time?
the program I used ( neutron ) needs to run as admin.
This is why NTP runs as NTPD (like, a SVCHOST, a daemon,
rather than run as a Ring 3 application).
You are not supposed to be elevating everything you
run in Ring 3 to administrator. It defeats the <cough>
security model.
neutron doesn't run as background program.
I have to start it manually and it stops after one run. After it has
finished you don't see it running or active in a program like
proceshacker. And elevating everything I run to admin? No thank you.
Keep it simple.
JJ
2023-07-25 10:07:28 UTC
Permalink
Post by J. P. Gilliver
Is there a setting that needs to be changed from its default, to allow
applications to change the system time? I have an old application that
periodically checks with a time server, and corrects the system time if
different: its log window shows it is making a correction, but it isn't
- next time it checks, its log window shows it is making the same
correction (and I can see the clock is out by the amount shown).
Windows 7 requires elevated rights to change the system time. So make sure
the application is run elevated.

If it's run at computer startup using program shortcut or registry, move it
to a scheduled task and make sure it's configured to run with the highest
privileges (tick the checkbox).
Brian Gregory
2023-08-01 22:46:02 UTC
Permalink
Post by JJ
Windows 7 requires elevated rights to change the system time. So make sure
the application is run elevated.
+1

But I wouldn't recommend running Turnpike with elevated privileges. It
does too much other stuff.
--
Brian Gregory (in England).
J. P. Gilliver
2023-08-02 04:13:41 UTC
Permalink
Post by Brian Gregory
Post by JJ
Windows 7 requires elevated rights to change the system time. So make sure
the application is run elevated.
+1
But I wouldn't recommend running Turnpike with elevated privileges. It
does too much other stuff.
Agreed. I did try it, and it did indeed correct the time. But I normally
don't.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

"We're plumbing shallows we didn't know existed here" - Jeremy Paxman (as
quizmaster of "University Challenge"), 1998 (when losing team suddenly put on a
spurt by showing knowledge of things like the Eurovision Song Contest ...)
Loading...