ASM #17383 - Fixed error that time constraint being off

Change-Id: I7b00a4b0d1bd7822cd3f751264badfa62afc3bcb

Former-commit-id: d0e8d057f765d95c65ef121e784152d05bd1187c
This commit is contained in:
Yun.Teng 2015-04-16 17:57:45 +01:00
parent c9337caeb2
commit dd5fd66fa5

View file

@ -48,6 +48,8 @@
# 01/08/2015 #15035 lshi add site WNJ
# 12/03/2014 #3866 rferrel Added GFS20
# 03/30/2015 #17206 yteng Changed some parameters that are not rate parameters
# 04/15/2015 #17383 yteng Change localTC to fix error that time constraints
# being off
########################################################################
#----------------------------------------------------------------------------
@ -978,8 +980,8 @@ def localTC(start,repeat,duration,dst):
timezone = SITES[GFESUITE_SITEID][3]
import dateutil.tz, datetime
tz = dateutil.tz.gettz(timezone)
dt = datetime.datetime.utcnow()
delta = tz.utcoffset(dt) + tz.dst(dt)
local = datetime.datetime.now(tz)
delta = tz.utcoffset(local) - tz.dst(local)
offset = delta.days*86400 + delta.seconds
start = start - offset
if dst == 1: