Skip to content

Commit

Permalink
[remind] Solve issues with time not being properly reported
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Mar 18, 2013
1 parent 833df85 commit 01afabc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def at(willie, trigger):
return willie.NOLIMIT
else:
tzi = timezone(tz)
elif willie.db and tz in willie.db.preferences:
tz = willie.db.preferences.get(tz, 'tz')
elif willie.db and trigger.nick in willie.db.preferences:
tz = willie.db.preferences.get(trigger.nick, 'tz')
if tz:
tzi = timezone(tz)
else:
Expand All @@ -189,7 +189,7 @@ def at(willie, trigger):

now = datetime.now(tzi)
timediff = (datetime(now.year, now.month, now.day, int(hour), int(minute),
int(second), tzinfo=tzi)
int(second), tzinfo=now.tzinfo)
- now)
duration = timediff.seconds

Expand All @@ -215,7 +215,7 @@ def create_reminder(willie, trigger, duration, message, tz):
if willie.db and trigger.nick in willie.db.preferences:
tformat = (willie.db.preferences.get(trigger.nick, 'time_format')
or "%F - %T%Z")
timef = datetime.now(tz).strftime(tformat)
timef = datetime.fromtimestamp(t, tz).strftime(tformat)

willie.reply('Okay, will remind at %s' % timef)
else:
Expand Down

0 comments on commit 01afabc

Please sign in to comment.