karawin / Ka-Radio32

esp32 version of Ka-Radio (https://github.com/karawin/Ka-Radio) by jp Cocatrix
515 stars 155 forks source link

timezone setup #216

Closed esaulenka closed 2 years ago

esaulenka commented 3 years ago

Hello!

  1. This code looks very dirty https://github.com/karawin/Ka-Radio32/blob/571d4c9cfc7de54758d13e2592883516c9008c3d/main/interface.c#L1259

tzoffseth and tzoffsetm are only single byte variables, but sscanf will write 4 bytes in it. So, you will mess up nearest variables.

  1. Also, please add eeprom flag that enables daylight saving time.
karawin commented 3 years ago

Yes, you are right, the code is wrong. I will change it like the one I made for webserver.c int offtzo= 0; int offtzoh= 0; sscanf(tzo,"%d:%d",&offtzoh,&offtzo); g_device->tzoffseth = offtzoh; g_device->tzoffsetm = offtzo;

Daylight saving time is on by default. Ok, i will add it.

esaulenka commented 3 years ago

Daylight saving time is on by default.

Yes, I see. But our government already turned it off :-)

Ok, i will add it.

Thanks for this improvement!