report seen time in localtime, not UTC

This commit is contained in:
Brian S. Stephan 2010-07-25 11:32:09 -05:00
parent f6b0a5c6f1
commit 9183c6f81f
1 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,8 @@ import os
import re
import sys
from dateutil.relativedelta import *
from dateutil.tz import *
import irclib
#####
@ -98,8 +100,8 @@ def sub_report_seen(connection, event, nick, userhost, replypath, what, admin_un
query = whats[1]
try:
seendata = config.get('seen', query).split('|:|')
converted = datetime.strptime(seendata[1], "%Y-%m-%dT%H:%M:%S.%f")
connection.privmsg(replypath, 'last saw ' + query + ' at ' + converted.strftime("%Y/%m/%d %H:%M:%S") + ' saying \'' + seendata[2] + '\'')
converted = datetime.strptime(seendata[1], "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=tzutc())
connection.privmsg(replypath, 'last saw ' + query + ' at ' + converted.astimezone(tzlocal()).strftime("%Y/%m/%d %H:%M:%S %Z") + ' saying \'' + seendata[2] + '\'')
except NoOptionError: pass
#####