Announcement

Collapse
No announcement yet.

Re: Update Windows PC time?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Re: Update Windows PC time?

    I'm trying to send an update System Clock command that would update the System Time to an NTS server URL of my choice (such as "time.nist.gov"). Any simple way to do this? I found a solution a few days ago but haven't been able to find it since. Any suggestions?

    Thanks everyone!
    "White-colla-AMS-gangsta."

  • #2
    Or a way to easily get world time? I'm looking for a way to get accurate "SS" from HH:MM:SS but the computer's clock skews until manually updated. I can update the PC System Time or grab accurate world time from somewhere trustworthy. I just want to make sure that it's okay to do so (that I'm not just spamming the NTS every 10 mins or so without being authorized to do so). Thanks all!
    "White-colla-AMS-gangsta."

    Comment


    • #3
      If you tampered with my system time I would not be a happy bunny, what are your goals as there might be a non intrusive way to achieve it?

      Comment


      • #4
        If your application is running with admin privileges, you should be able to run "w32tm" and force a clock resync. However, current editions of Windows perform an automatic clock sync in the background periodically, so it shouldn't be that far off the actual time.

        Ulrich

        Comment


        • #5
          Totally agree. What I'm trying to get is what System.GetTime does only from an NTS server (such as "time.nist.gov"). If there's an internet connection, grab world time from a specific server. If not, use the System Time. Problem is, as we know, the System Time is only as accurate as the last update. So "Accurate could be off by .5 seconds or 5 years. I need accuracy to within .5 seconds if possible. That means a likely check every 15 mins or so.

          Ulrich, these automatic updates aren't cutting it, unfortunately. On external hardware, it's been noted that they are only 2x per day. =\ And that with those sorts of refreshes, time can skew by multiples of seconds. Bad for sync. =(

          Thoughts on grabbing NTS server time then? Cause I agree about messing with the System Clock.
          "White-colla-AMS-gangsta."

          Comment


          • #6
            You can use w32tm also to compare the current time with the time on a remote server which answers to NTP requests. Something like this should work:
            Code:
            w32tm /stripchart /computer:time.windows.com /dataonly /samples:5
            This should give you a value to be added to the local computer's time, resulting in the correct time without actually changing the clock. Or so I hope.

            Ulrich

            Comment


            • #7
              I might be able to write a small plugin which allows you to retrieve the utc-time and shifted time (time+bias) from an NTP server, if you're interested. NTPC.RetrieveNTPTime(server[, timeout = 120ms]) would then do it all!
              Bas Groothedde
              Imagine Programming :: Blog

              AMS8 Plugins
              IMXLH Compiler

              Comment


              • #8
                http://www.indigorose.com/forums/thr...eserver-Client)
                Bas Groothedde
                Imagine Programming :: Blog

                AMS8 Plugins
                IMXLH Compiler

                Comment


                • #9
                  Awesome,

                  Thank you Imagine! And thanks Ulrich. I'll look into both!
                  "White-colla-AMS-gangsta."

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎