Last active
January 18, 2018 14:23
-
-
Save sleepless-se/545a5590585ff4c4fb78b62f74396826 to your computer and use it in GitHub Desktop.
[python] Get japan yesterday timedate as string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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