OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › OpenSprinkler Interval Program now available for OSPi! › Re: Re: OpenSprinkler Interval Program now available for OSPi!
But I do still have a concern with trying to deal with timezones and time calculations in the code. The OS already knows the timezone and calculates the localtime accordingly. It handles daylight savings where appropriate and changes when local governments change these. Trying to duplicate all of that in the python code is fraught with problems as we’ve seen. And if you happen to miss the configuration setting in the options screen, as I did between one of the updates recently, you get very weird results of some things running generally as you would expect but then somethings run on the wrong days if the timezone settings line up badly, etc.
Can you see any problems with changing all references to time.time() to time.localtime() and remove all the timezone calculations?
I notice code like this:
dse = int((time.time()-time.timezone)/86400) # days since epoch
which doesn’t take DST into account which should become more accurate too.
P.S. I hope I haven’t sounded to rude here. I am extremely impressed with the work you have done.