fix incorrect parsing of timestamps, v0.6.34
This commit is contained in:
parent
ef531ca1c9
commit
feb031d587
4
CHANGES
4
CHANGES
|
|
@ -1,6 +1,10 @@
|
||||||
CHANGES
|
CHANGES
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
# v0.6.34
|
||||||
|
|
||||||
|
- fixed timestamps being parsed incorrectly
|
||||||
|
|
||||||
# v0.6.33
|
# v0.6.33
|
||||||
|
|
||||||
- added ambiguity parsing for normal position reports
|
- added ambiguity parsing for normal position reports
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ from datetime import date as _date
|
||||||
__date__ = str(_date.today())
|
__date__ = str(_date.today())
|
||||||
del _date
|
del _date
|
||||||
|
|
||||||
__version__ = "0.6.33"
|
__version__ = "0.6.34"
|
||||||
__author__ = "Rossen Georgiev"
|
__author__ = "Rossen Georgiev"
|
||||||
__all__ = ['IS', 'parse', 'passcode']
|
__all__ = ['IS', 'parse', 'passcode']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -316,11 +316,11 @@ def _parse_timestamp(body, packet_type=''):
|
||||||
try:
|
try:
|
||||||
# zulu hhmmss format
|
# zulu hhmmss format
|
||||||
if form == 'h':
|
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
|
# zulu ddhhmm format
|
||||||
# '/' local ddhhmm format
|
# '/' local ddhhmm format
|
||||||
elif form in 'z/':
|
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 = utc.strptime(timestamp, "%Y%m%d%H%M%S")
|
||||||
timestamp = time.mktime(timestamp.timetuple())
|
timestamp = time.mktime(timestamp.timetuple())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue