mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fix timezone handling of b338a2370
.
This commit is contained in:
parent
73ed9635b5
commit
39df987274
@ -152,7 +152,7 @@ class IrcMsg(object):
|
||||
if 'time' in self.server_tags:
|
||||
s = self.server_tags['time']
|
||||
date = datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%fZ')
|
||||
print(repr(date))
|
||||
date = date.replace(tzinfo=datetime.timezone.utc)
|
||||
self.time = date.timestamp()
|
||||
else:
|
||||
self.time = time.time()
|
||||
|
@ -155,7 +155,7 @@ class IrcMsgTestCase(SupyTestCase):
|
||||
|
||||
msg = ircmsgs.IrcMsg('@time=2011-10-19T16:40:51.620Z '
|
||||
':Angel!angel@example.org PRIVMSG Wiz :Hello')
|
||||
self.assertEqual(msg.time, 1319035251.62)
|
||||
self.assertEqual(msg.time, 1319042451.62)
|
||||
|
||||
class FunctionsTestCase(SupyTestCase):
|
||||
def testIsAction(self):
|
||||
|
Loading…
Reference in New Issue
Block a user