master
sfan5 2015-03-29 15:53:07 +02:00
parent 762431c668
commit 52f5cc77f2
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,8 @@ import feedparser # sudo pip install feedparser
rssnotify = {}
def to_unix_time(tstr):
if tstr.endswith("Z"):
tstr = tstr[:-1] + "+00:00"
r = re.compile(r"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})([-+])(\d{2}):(\d{2})")
g = r.match(tstr).groups(1)
# This function would be like 100% shorter if the time library didn't suck so hard.