From 010b1198daf7edc7a8c875fbc1ff3c818249cc43 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 24 Feb 2017 00:14:23 +0100 Subject: [PATCH] Properly handle midnight tweets --- markov.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markov.py b/markov.py index c102691..c0e0cb0 100755 --- a/markov.py +++ b/markov.py @@ -38,7 +38,7 @@ def markovifyText(text): def getTime(now = datetime.datetime.now()): thenminute = 15 if now.minute < 15 else 30 if now.minute < 30 else 45 if now.minute < 45 else 0 - thenhour = now.hour + 1 if thenminute == 0 else now.hour + thenhour = (now.hour + 1 if now.hour < 23 else 0) if thenminute == 0 else now.hour then = datetime.datetime(now.year, now.month, now.day, thenhour, thenminute, 0) return (then - datetime.datetime.now()).seconds