Go Down

Topic: How to get date and time through Ethernet connection? (Read 167 times) previous topic - next topic

gabe-soares

Hey guys,
    So, I'm doing a project for my scientific iniciation, and I have a Arduino calling some procedures on my MySQL server, using a Ethernet shield for that, the thing is that I need to send as parameters for the procedure two dates and times. To do that, I need to get the atual date and time, which I cannot yet.
I did saw a lot of examples and different libraries, but some of them were too old and didn't work, and a lot of them was very confusing (probably my fault on this, I'm new to Arduino).
    That's it, how do I get the date and time through Ethernet shield (Using a RTC isn't an option) in the most simple way possible?

Thanks for the help antecipated! :D

pert

Take a look at and test out File > Examples > Ethernet > UdpNtpClient.

6v6gt

If you are anyway talking to a mySql database and parsing results from it, another alternative is to get the datestamp from there.

Code: [Select]

SELECT SYSDATE();


https://w3resource.com/mysql/date-and-time-functions/mysql-sysdate-function.php

Go Up