Hi. I did the Arduino IoT scheduler tutorial. All works fine but for some reason the Time picker is out by 2 hours. The scheduler seems to be on time but not the time picker. I set my time zone for Africa/Johannesburg but if I calculate the time the picker shows. It seems to be the time in Dubai.
Im using a Arduino 33 IoT with a USB cable and I work on the cloud.
Is there away to correct this error? Maybe writing some code or set my ting up in a certain way?
Hi. I solved the challenge. The time that you get from the cloud with the instruction ArduinoCloud.getLocalTime() is in epoch. So I just subtracted 7200 as 1 hour is 3600 seconds. This gave me the correct time for South Africa. So my line of code looked like this
time_read = ArduinoCloud.getLocalTime() - 7200;
I hope this help somebody ells with this instruction and time picker.
Hi @flowgrow,
what you are describing here is a bit strange and should not happen: after you have correctly configured your thing timezone, ArduinoCloud.getLocalTime() should return your local time and ArduinoCloud.getInternalTime() the UTC time. No additional offset shoud be required in order to read the correct time.
I'm starting to suspect that in some conditions the internalTime has alreay some offset applied.
Could you please add avariable to your sketch and report me its value ?
utc_time = ArduinoCloud.getInternalTime();
Don't forget to write also the time you run the test so we can compare it to localTime and internalTime from the library.