leonvandenbeukel / Round-LED-Clock

Wi-Fi connected round LED Clock
Apache License 2.0
134 stars 64 forks source link

timeZones issue #18

Open loverboyritesh opened 4 years ago

loverboyritesh commented 4 years ago

2 points /// 1: negative time zones not working 2: 30 mins time zones like -5.30 not working ///

Is it just with me or anyone else tried and facing similar issues //

smithellis commented 4 years ago

If you are in a timezone that is negative you need to patch the file up to allow the integer to be signed. As it is set up, it only works with unsigned ints. I did a find and replace to remove "unsigned" from everywhere it existed except for here:

while ((unsigned)(days += (LEAP_YEAR(year) ? 366 : 365)) <= time) { year++; }

St3v3caldwell commented 2 years ago

If you change unsigned to signed it you'll be able to enter a negative time zone. I changed line 20 to a signed long from unsigned: signed long timeZone = -5.0; and line 244: void convertTime(int32_t time) { //changed to int32_t from uint32_t Your serial monitor will show the correct hour, date, time and all that. hope this helps Steve