From bd8b1867aa7b85f59fa9224726005b3effe3ca3b Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 10 Mar 2015 17:55:30 +0000 Subject: [PATCH] improved _parse_timestamp incorrect timestamps will now return timestamp 0 and get clipped from the body so further parsing can occur. stopped using utc.second to fill the second for z/ formats --- aprslib/parse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aprslib/parse.py b/aprslib/parse.py index b1222e9..1020251 100644 --- a/aprslib/parse.py +++ b/aprslib/parse.py @@ -331,7 +331,7 @@ def _parse_timestamp(body, packet_type=''): if packet_type == '>' and form != 'z': pass - if form in "hz/": + else: body = body[7:] try: @@ -341,7 +341,9 @@ def _parse_timestamp(body, packet_type=''): # zulu ddhhmm format # '/' local ddhhmm format elif form in 'z/': - timestamp = "%d%02d%s%02d" % (utc.year, utc.month, ts, utc.second) + timestamp = "%d%02d%s%02d" % (utc.year, utc.month, ts, 0) + else: + timestamp = "19700101000000" timestamp = utc.strptime(timestamp, "%Y%m%d%H%M%S") timestamp = time.mktime(timestamp.timetuple())