Merge branch 'dev', v0.6.34

feb031d - fix incorrect parsing of timestamps, v0.6.34
This commit is contained in:
Rossen Georgiev 2015-01-08 15:45:38 +00:00
commit 0f8d54db21
3 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,10 @@
CHANGES
-------
# v0.6.34
- fixed timestamps being parsed incorrectly
# v0.6.33
- added ambiguity parsing for normal position reports

View File

@ -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']

View File

@ -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())