Fix expiration date parsing issue

This commit is contained in:
K2IE 2024-04-02 13:19:42 -04:00
parent 421aca6699
commit 2680769fcd
3 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,5 @@
Package: noaacap Package: noaacap
Version: 1.3.0 Version: 1.3.1
Section: hamradio Section: hamradio
Priority: extra Priority: extra
Maintainer: Dan Srebnick <k2ie at k2ie.net> Maintainer: Dan Srebnick <k2ie at k2ie.net>

View File

@ -6,7 +6,7 @@
## ##
## See /usr/local/share/noaacap/CHANGELOG for change history ## See /usr/local/share/noaacap/CHANGELOG for change history
## ##
version = "1.3" version = "1.3.1"
import sys import sys
import pytz import pytz
@ -199,16 +199,18 @@ for i in range(0, count):
if ProductClass != "/O": #Loop if not operational if ProductClass != "/O": #Loop if not operational
continue continue
EventEnd = "20" + EventEnd
# Is alert expired? # Is alert expired?
now = datetime.datetime.now(datetime.timezone.utc) now = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
# Fix exit on exp = '000000T0000Z' # Fix exit on exp = '000000T0000Z'
try: try:
exp = dateutil.parser.parse(EventEnd) exp = dateutil.parser.parse(EventEnd)
except: except:
exp = now exp = now
# log.debug('Time Now: ' + datetime.datetime.strftime(now,"%y-%m-%d %H:%M") + '\n' + \ # log.debug('Time Now: ' + datetime.datetime.strftime(now,"%y-%m-%d %H:%M"))
# 'Expiration: ' + datetime.datetime.strftime(exp,"%y-%m-%d %H:%M")) # log.debug('Expiration: ' + datetime.datetime.strftime(exp,"%y-%m-%d %H:%M"))
if now > exp: if now > exp:
log.debug("Alert Expired") log.debug("Alert Expired")

View File

@ -1,5 +1,9 @@
noaacap changelog noaacap changelog
## ##
Version: 1.3.1
Release: April 2, 2024
Fix expiration date parsing issue
##
Version: 1.3 Version: 1.3
Release: TBD Release: TBD
Fixed truncation bug in compressed zone list Fixed truncation bug in compressed zone list