handle milliseconds in time result stanza. Fixes #5905
This commit is contained in:
parent
896fe73945
commit
cfac956598
1 changed files with 8 additions and 4 deletions
|
@ -152,12 +152,16 @@ class TimeResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
||||||
t = t.replace(tzinfo=UTC())
|
|
||||||
self.time_info = t.astimezone(contact_tz()).strftime('%c')
|
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
log.info('Wrong time format: %s' % str(e))
|
try:
|
||||||
return
|
t = datetime.datetime.strptime(utc_time,
|
||||||
|
'%Y-%m-%dT%H:%M:%S.%fZ')
|
||||||
|
except ValueError, e:
|
||||||
|
log.info('Wrong time format: %s' % str(e))
|
||||||
|
return
|
||||||
|
|
||||||
|
t = t.replace(tzinfo=UTC())
|
||||||
|
self.time_info = t.astimezone(contact_tz()).strftime('%c')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class GMailQueryReceivedEvent(nec.NetworkIncomingEvent):
|
class GMailQueryReceivedEvent(nec.NetworkIncomingEvent):
|
||||||
|
|
Loading…
Add table
Reference in a new issue