Closed wr300000 closed 4 years ago
Your issue made me find a bug but I am not sure that was the problem you are referring to? If the timezone offset makes the day of the month change, then the hour isn't correct anymore:
>>> settime(0) # offset 0h
2020-03-08 17:25:52
>>> settime(1) # offset 1h
2020-03-08 18:25:54
>>> settime(5) # offset 5h
2020-03-08 23:25:55
>>> settime(6)
2020-03-09 05:25:57
>>> settime(7)
2020-03-09 12:26:02
>>> settime(8)
2020-03-09 20:26:05
But I'm not sure what timezones have to do with the equator? Also day light saving condition: You mean that it automatically knows about the day light saving conditions and adjusts the time by +-1 hour? If so, then this was just too complicated for the use-case because the rest of the framework only uses the time for logging and the statistic on when the controller was restarted the last time. I hoped that at one point someone would fix the ntptime module to synchronize according to timezone.
Hi Kevin, I guess that you are in German and your local lime will different from UK (UTC+0) exactly whole year, I guess so that your country have day light saving adjustment as well, am I right?. My local is in UTC+7 , Bangkok time which we don't have day light saving adjustment so once UTC+0 is in day light saving interval then Bangkok time will be diff one hour from NTC time. best regards,
On Sun, Mar 8, 2020 at 11:30 PM Kevin Köck notifications@github.com wrote:
Your issue made me find a bug but I am not sure that was the problem you are referring to? If the timezone offset makes the day of the month change, then the hour isn't correct anymore:
settime(0) 2020-03-08 17:25:52 settime(1) 2020-03-08 18:25:54 settime(5) 2020-03-08 23:25:55 settime(6) 2020-03-09 05:25:57 settime(7) 2020-03-09 12:26:02 settime(8) 2020-03-09 20:26:05
But I'm not sure what timezones have to do with the equator? Also day light saving condition: You mean that it automatically knows about the day light saving conditions and adjusts the time by +-1 hour? If so, then this was just too complicated for the use-case because the rest of the framework only uses the time for logging and the statistic on when the controller was restarted the last time. I hoped that at one point someone would fix the ntptime module to synchronize according to timezone.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kevinkk525/pysmartnode/issues/15?email_source=notifications&email_token=AIGOFLWQBTN2O6FX3GQV2P3RGPB3HA5CNFSM4LD2TOM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE2QWY#issuecomment-596224091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGOFLSTYAKOG4ULPTEQVM3RGPB3HANCNFSM4LD2TOMQ .
-- Wattana R.
UTC is without daylight savings. When day light savings start in Germany, I have to change my configured offset from +1 to +2. So I basically change the offset configuration twice a year.
So your offset from UTC will always be correct if you have no daylight savings. (except for the offset error in my first answer where the offset changes the current day number. I'll fix that soon).
Yes, this is my point...if I'm not wrong you will change your clock every Mar and October time... Could you add one more offset time to cover it automatically later manual changing on config file? If you don't have plan to do it so please kindly let me know then I will have to add some checking before using your files.py under Networking directory.. best regards,
On Sun, Mar 8, 2020 at 11:48 PM Kevin Köck notifications@github.com wrote:
UTC is without daylight savings. When day light savings start in Germany, I have to change my configured offset from +1 to +2. So I basically change the offset configuration twice a year.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kevinkk525/pysmartnode/issues/15?email_source=notifications&email_token=AIGOFLW4SR7UK227T2L7V7LRGPD65A5CNFSM4LD2TOM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25VI#issuecomment-596225749, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGOFLQKFWKJ3NV32NWG5JTRGPD65ANCNFSM4LD2TOMQ .
-- Wattana R.
I'm sorry but I do not understand what you are trying to explain.. What additional offset time? UTC+0 is always in the same time and doesn't change during the year. You don't need to change anything.
Independent of this problem: Pull the latest changes, I fixed the offset: https://github.com/kevinkk525/pysmartnode/commit/345460f071edbf40ba5c3dc0ffc3ec814f2a16c5
If that the case so why have you changed your configuration file twice a year? I just need to make sure on this before flash your code on my ESP chips... I'm not expert but I think it should be adjust automatically once it's on production...
On Sun, Mar 8, 2020 at 11:57 PM Kevin Köck notifications@github.com wrote:
I'm sorry but I do not understand what you are trying to explain.. What additional offset time? UTC+0 is always in the same time and doesn't change during the year. You don't need to change anything.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kevinkk525/pysmartnode/issues/15?email_source=notifications&email_token=AIGOFLTMKTBXJMSWGJUMQELRGPE67A5CNFSM4LD2TOM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE3EQA#issuecomment-596226624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGOFLT2RI4AZUADP67FPDLRGPE67ANCNFSM4LD2TOMQ .
-- Wattana R.
UTC+0 is always the same time. Germany is UTC+2 from March and UTC+1 from October because of daylight savings. So I have to change my offset twice a year.
Did you get it to work? Any other issues?
Hi Kevin, Thank you for following up, I'm currently using my script to change DLS (midified from JumpZero). I've moved to use your IoT platform yet but I will. Thank you for your kind support again. best rgds,
On Sat, Apr 11, 2020 at 12:28 PM Kevin Köck notifications@github.com wrote:
Did you get it to work? Any other issues?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kevinkk525/pysmartnode/issues/15#issuecomment-612333107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGOFLT6JB7M5ZHBUMLMO4DRL75WFANCNFSM4LD2TOMQ .
-- Wattana R.
Hi Kevin, I'm trying to use your pysmartnode but seem like day light saving is not offset for country which locate near equator such as Thailand (UTC+7)
Your below current code under Networking directory are all not covering day light saving condition. Could you kindly reconsider? tm = tm[0:3] + (0,) + (tm[3] + config.RTC_TIMEZONE_OFFSET,) + tm[4:6] + (0,)