Skip to content
This repository has been archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
Adjust to work properly when DST occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
besynnerlig committed Aug 7, 2018
1 parent c0b6a5e commit 02cc2c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Script Examples/astro.py
Expand Up @@ -60,10 +60,10 @@ def execute(self, modules, inputs):

# Get the time period start times for today
now = DateTime()
morningStart = now.withTimeAtStartOfDay().plusHours(self.config.timeOfDay['morningStart']['Hour']).plusMinutes(self.config.timeOfDay['morningStart']['Minute']).toInstant()
dayStart = now.withTimeAtStartOfDay().plusHours(self.config.timeOfDay['dayStart']['Hour']).plusMinutes(self.config.timeOfDay['dayStart']['Minute']).toInstant()
eveningStart = now.withTimeAtStartOfDay().plusHours(self.config.timeOfDay['eveningStart']['Hour']).plusMinutes(self.config.timeOfDay['eveningStart']['Minute']).toInstant()
nightStart = now.withTimeAtStartOfDay().plusHours(self.config.timeOfDay['nightStart']['Hour']).plusMinutes(self.config.timeOfDay['nightStart']['Minute']).toInstant()
morningStart = now.withTime(self.config.timeOfDay['morningStart']['Hour'],self.config.timeOfDay['morningStart']['Minute'],0,0).toInstant()
dayStart = now.withTime(self.config.timeOfDay['dayStart']['Hour'],self.config.timeOfDay['dayStart']['Minute'],0,0).toInstant()
eveningStart = now.withTime(self.config.timeOfDay['eveningStart']['Hour'],self.config.timeOfDay['eveningStart']['Minute'],0,0).toInstant()
nightStart = now.withTime(self.config.timeOfDay['nightStart']['Hour'],self.config.timeOfDay['nightStart']['Minute'],0,0).toInstant()

timeOfDay = TIMEOFDAY['NIGHT']
if (now.isAfter(morningStart) and now.isBefore(dayStart)):
Expand Down

0 comments on commit 02cc2c8

Please sign in to comment.