PaulStoffregen/Time

Ignore SetTime(0)

Bolukan opened this issue · 1 comments

Description

In https://github.com/gmag11/NtpClient#developer setTime(0) is called (0 is return of other function) with the presumption setTime(0) would be ignored by your library. Do you accept a change to ignore setTime(0) calls in your library? If yes, I will propose a pull request.

Steps To Reproduce Problem

setTime(0) resets time to 1970.

Hardware & Software

N/A

Arduino Sketch

N/A

Errors or Incorrect Output

N/A

I would expect that setTime(0) sets the time to 00:00:00 UTC on 1 January 1970.
Everything else would be unexpected behavior for me. You should just catch this case like...
if (timevariable != 0)