PaulStoffregen / Time

Time library for Arduino
http://playground.arduino.cc/code/time
1.24k stars 664 forks source link

12/31/2097 #166

Open PythonEatsSQuirreL opened 2 years ago

PythonEatsSQuirreL commented 2 years ago

I am using esp32 and TinyGPS++ to save a csv file on my SD card with the time, date, alt, lng, lat. The CSV file is saved as created on 12/31/2097 and the year() month() day() hour() minute() seconds() is 2000-0-0 00:00:00.

Sometimes the year is 1999, sometimes 2000.

Any fixes?

Nathan-ma commented 2 years ago

First, leave the code you are using. is difficult to understand what you are doing without actually seeing it.

Second, you need to set a date and time. if you did this already, use Serial.println(now()) to print the time stamp, copy it and past on an epoch website (Like this one).

That's the date you have set, you can change it to whatever value you want, the library will just keep incrementing this value each second, you gotta set it first either using a RTC or NTC.