Skip to content

Instantly share code, notes, and snippets.

@sleepless-se
Last active January 18, 2018 14:23
Show Gist options
  • Save sleepless-se/545a5590585ff4c4fb78b62f74396826 to your computer and use it in GitHub Desktop.
Save sleepless-se/545a5590585ff4c4fb78b62f74396826 to your computer and use it in GitHub Desktop.
[python] Get japan yesterday timedate as string
from datetime import datetime
def getYesterDay():
JST = timezone(timedelta(hours=+9), 'JST')
d = datetime.now(JST)
yesterday = str(d.year) +"-"+ str(d.month) +"-"+ str(d.day-1)
print(yesterday)
return yesterday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment