I have an UNIX Timestamp in my Arduino Sketch and would like to get the day of the week of this timestamp (1-7).
How can I convert the timestamp to get the day of the week?
I have an UNIX Timestamp in my Arduino Sketch and would like to get the day of the week of this timestamp (1-7). How can I convert the timestamp to get the day of the week? |
||||
The simplest solution to that problem is to download the Time library and use the weekday() function:
Cheers! |
|||||||||||||
|
date +%s
says 1455407637 (for Sat Feb 13 16:53:57 MST 2016),date -d@1455407637 +%u
says 6. – jwpat7 Feb 13 '16 at 23:58