Fix for EventEnd of 000000T0000Z which appeared during Tropical Storm Isaias

This commit is contained in:
Dan Srebnick 2020-08-03 20:08:16 -04:00
parent 123ac3e219
commit c783edd4e1
1 changed files with 5 additions and 1 deletions

View File

@ -213,7 +213,11 @@ for i in range(0, count):
# Is alert expired?
now = datetime.datetime.utcnow()
# Fix exit on exp = '000000T0000Z'
try:
exp = datetime.datetime.strptime(EventEnd,'%y%m%dT%H%MZ')
except:
exp = now
log.debug('Now: ' + datetime.datetime.strftime(now,"%y-%m-%d %H:%M") + \
' Exp: ' + datetime.datetime.strftime(exp,"%y-%m-%d %H:%M"))
if now > exp: