-
Notifications
You must be signed in to change notification settings - Fork 718
Description
Maybe I am missing something, or the reason behind it, probably because of Y2K of some such reason, so please enlighten me, or add a clear note to the documentation.
The range of the year is (2000 -- 2099). This seems a bit restrictive, especially when trying to do get the difference between 2 dates in 2 different centuries.
For example:
`
DateTime now = DateTime (2023, 7, 19);
DateTime then = DateTime (1980, 5, 25);
Serial.print("Now: ");
Serial.print(now.year(), DEC);
Serial.print('-');
Serial.print(now.month(), DEC);
Serial.print('-');
Serial.println(now.day(), DEC);
Serial.print("Then: ");
Serial.print(then.year(), DEC);
Serial.print('-');
Serial.print(then.month(), DEC);
Serial.print('-');
Serial.println(then.day(), DEC);
// Serial Output
// Now: 2023-7-19 <-- correct
// Then: 2188-5-25 <-- problem
`
Like I said, I probably missed the reason for this decision, if it is documented, so would like to know if there is a way around this limitation. Thanks