# Sync time P.C. to Arduino.

#### Pommie

##### Well-Known Member
This seems to come up every now and again and I needed to do this myself so here's an Arduino Sketch and a Visual Basic program to synchronize the Arduino clock (DS1307) to the P.C. clock. The VB program is in Visual Studio 2012 express but should work in any of the later releases as well - I've tried it in VS2017 and all OK.

It's self explanatory (I think) and looks like this.

Hope it's useful to someone.

BTW, the serial monitor can't be running at the same time and if you wish to compile the sketch then you need to disconnect the VB program.

Mike.

#### Attachments

• 87.5 KB Views: 3
• 3.4 KB Views: 5

#### SPDCHK

##### Member
Nice. Thanks. Will keep this link saved for when I do need it.

#### rjenkinsgb

##### Well-Known Member
For any IoT type devices that have internet connectivity, you can get the time direct from an internet time server quite simply.

This gives the details needed to set up a request frame (just a lower case c padded with 47 space characters) and interpret the reply.
You could use a local server or eg. pool.ntp.org