Author Topic: Test code for using sntp to synchronize clock  (Read 100 times)

jimg

  • Member
  • ***
  • Posts: 369
Test code for using sntp to synchronize clock
« on: December 21, 2019, 06:02:11 AM »
This is some code I've been playing with to get an accurate time from an NTP time server.  I'll use the actual final product to update some microcontrollers and ds3231 modules, etc.

I thought I'd dump it here in case anyone else wanted to play with it.  It is hereby released to the public domain for all uses public and private without reference to me.  Use it any way you want.

This is pretty much a dead topic.   Now we just let windows set our time.

I started with six_L code from 2006.  This used a daytime server to get the time, but I learned a lot on how to communicate with a server using windows sockets.  I've included the original six_L code in the zip file.  Many thanks to six_L.

It now requires administrator privilege to update your clock, so I added a manifest requiring the permissions.

Bear in mind, this is just a test platform for me to test my code, not a full blown polished app :)