Created
February 3, 2015 11:01
-
-
Save spoterianski/e76d2c1cc4b78528b285 to your computer and use it in GitHub Desktop.
get yesterday in python
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
""" | |
Get yesterday | |
""" | |
def get_yesterday(self): | |
today = datetime.date.today() | |
d = datetime.timedelta(days=1) | |
yesterday = today - d | |
return yesterday.strftime('%Y%m%d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment