Describe your problem.
Calculation
tm.Wday = ((time + 4) % 7) + 1; // Sunday is day 1
will give for example Friday if time = 0 but 1970/1/1 is Thursday.
There is no need to have "+1" there.
Steps To Reproduce Problem
Please give detailed instructions needed for anyone to attempt to reproduce the problem.
Hardware & Software
Board
Shields / modules used
Arduino IDE version
Teensyduino version (if using Teensy)
Version info & package name (from Tools > Boards > Board Manager)
Operating system & version
Any other software or hardware?
Arduino Sketch
// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include <Arduino.h>
// libraries: give links/details so anyone can compile your code for the same result
void setup() {
}
void loop() {
}
Errors or Incorrect Output
If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.
Description
day of week is incorrect
Describe your problem. Calculation tm.Wday = ((time + 4) % 7) + 1; // Sunday is day 1
will give for example Friday if time = 0 but 1970/1/1 is Thursday. There is no need to have "+1" there.
Steps To Reproduce Problem
Please give detailed instructions needed for anyone to attempt to reproduce the problem.
Hardware & Software
Board Shields / modules used Arduino IDE version Teensyduino version (if using Teensy) Version info & package name (from Tools > Boards > Board Manager) Operating system & version Any other software or hardware?
Arduino Sketch
Errors or Incorrect Output
If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.