From feb031d58736a4511689bc667879cb32644a6ade Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Thu, 8 Jan 2015 15:43:32 +0000 Subject: [PATCH] fix incorrect parsing of timestamps, v0.6.34 --- CHANGES | 4 ++++ aprslib/__init__.py | 2 +- aprslib/parse.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 67feec3..2f7d9b7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ CHANGES ------- +# v0.6.34 + +- fixed timestamps being parsed incorrectly + # v0.6.33 - added ambiguity parsing for normal position reports diff --git a/aprslib/__init__.py b/aprslib/__init__.py index b3b9dfb..a8d1db3 100644 --- a/aprslib/__init__.py +++ b/aprslib/__init__.py @@ -37,7 +37,7 @@ from datetime import date as _date __date__ = str(_date.today()) del _date -__version__ = "0.6.33" +__version__ = "0.6.34" __author__ = "Rossen Georgiev" __all__ = ['IS', 'parse', 'passcode'] diff --git a/aprslib/parse.py b/aprslib/parse.py index f55445a..44bb31f 100644 --- a/aprslib/parse.py +++ b/aprslib/parse.py @@ -316,11 +316,11 @@ def _parse_timestamp(body, packet_type=''): try: # zulu hhmmss format if form == 'h': - timestamp = "%s%s%s%s" % (utc.year, utc.month, utc.day, ts) + timestamp = "%d%02d02d%s" % (utc.year, utc.month, utc.day, ts) # zulu ddhhmm format # '/' local ddhhmm format elif form in 'z/': - timestamp = "%s%s%s%s" % (utc.year, utc.month, ts, utc.second) + timestamp = "%d%02d%s%02d" % (utc.year, utc.month, ts, utc.second) timestamp = utc.strptime(timestamp, "%Y%m%d%H%M%S") timestamp = time.mktime(timestamp.timetuple())