Code: Select all
time_t now;
struct tm* timeinfo;
void Check_Time(void) {
time(&now);
timeinfo = localtime(&now);
Serial.println(timeinfo);
}
void setup() {
Serial.begin(115200);
}
void loop() {
Check_Time();
delay(1000);
}
Code: Select all
Thu Jan 1 00:07:57 1970
Thu Jan 1 00:07:58 1970
Thu Jan 1 00:07:59 1970
Thu Jan 1 00:08:00 1970
...
Code: Select all
time_t
Code: Select all
mktime