git://git.furryclan.net
/
furrycat
/
catbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1a7af9
)
Use proper UTZ datetime.
author
CMDR furrycat
<elite@furrycat.net>
Thu, 13 Apr 2017 16:02:42 +0000
(17:02 +0100)
committer
CMDR furrycat
<elite@furrycat.net>
Thu, 13 Apr 2017 16:02:42 +0000
(17:02 +0100)
bot.py
patch
|
blob
|
history
diff --git
a/bot.py
b/bot.py
index
25dfa75
..
e59e2ff
100644
(file)
--- a/
bot.py
+++ b/
bot.py
@@
-1,4
+1,5
@@
import asyncio
+import calendar
import datetime
import discord
import hashlib
@@
-669,7
+670,7
@@
def iso8601(timestamp):
return datetime.datetime.utcfromtimestamp(timestamp).isoformat()[:19] + 'Z'
def parse_iso8601(string):
- return
int(datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ').timestamp
())
+ return
calendar.timegm(datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ').utctimetuple
())
def ago(timestamp):
now = int(time.time())