Skip to content

Ultra-simple tracking of date and time using millis() on microcontrollers, for example Arduino and ESP32

License

Notifications You must be signed in to change notification settings

societyofrobots/date_time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

date_time

Ultra-simple tracking of date and time using millis() on microcontrollers, for example Arduino and ESP32.


Step 1:
Initialize current date/time variables in setup() of your code.

example,
//initialize date/time
month=1;
day=1;
year=21;
hour=0;
minute=0;


Step 2:
Call the this function whenever you need to calculate current date/time:
date_time_calculate();

important: Must be done at least once every 49 days, before the millis() timer overflows.


Step 3:
//Print out date/time
date_time_print();


Example code for use with IotWebConf and ESP32:
prampec/IotWebConf#213 (comment)

About

Ultra-simple tracking of date and time using millis() on microcontrollers, for example Arduino and ESP32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages