Properly handle midnight tweets
This commit is contained in:
parent
2e4cd0207d
commit
010b1198da
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue