OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Python interval program update 8/01/13 › Re: Re: Python interval program update 8/01/13
Dan in CA
Originally the program did automatic daylight time adjustment based on the time.localtime() tm_isdst value and did not use the time zone setting from the interval program’s options page.
In response to your earlier comments, I removed the automatic daylight time calculations and included the time zone setting from the options page. That allows for manual adjustment of the time by changing the setting in options.
Looking at Andrew’s post:
“Can you see any problems with changing all references to time.time() to time.localtime() and remove all the timezone calculations?”
The problem here is that time.time() returns a time stamp from the OS such as:
which is used in various calculations in the program.
time.localtime() returns a tuple:
time.struct_time(tm_year=2013, tm_mon=8, tm_mday=19, tm_hour=11, tm_min=45, tm_sec=39, tm_wday=0, tm_yday=231, tm_isdst=1)
which is a whole different animal.
To answer your question about when daylight saving time gets adjusted: The start and stop times for irrigation schedules are calculated starting at midnight for each day. Daylight saving time gets adjusted at midnight, and if a program is scheduled to start within the hour after midnight it might be affected.
I’d like to here what Ray might have to say in this regard.