now() function

Is it posible to reset the value of now() function without reseting the Arduino ?

Thanks in advance.

Which library?


The now() function keeps track of time ticks, using millis(), relative to the time set using setTime().

So, yes, you can lie and say that it is now some new time, or date, by calling setTime() again.

No, now() is giving you UNIX time. That is, the number of seconds that have passed since 12:00 AM Jan 1, 1970. Unless you have a time machine and can go back to that date, you shouldn't and can't reset unix time. You could lie to it and set the time and date to 1/1/70, but there's no reason in the world that you should ever need to.

What are you trying to accomplish? Why do you think you need to reset time?

Check the stopwatch class -

No, now() is giving you UNIX time.

Relative to something, of course. Like the current time [u]as the Arduino understands it[/u]. What the Arduino understands the current time to be CAN be changed. That doesn't mean that its new, or old, understanding is in agreement with any other clock on the planet. But the value returned by now() can be changed while the program is running.