Skip to content

Instantly share code, notes, and snippets.

@spoterianski
Created February 3, 2015 11:01
Show Gist options
  • Save spoterianski/e76d2c1cc4b78528b285 to your computer and use it in GitHub Desktop.
Save spoterianski/e76d2c1cc4b78528b285 to your computer and use it in GitHub Desktop.
get yesterday in python
"""
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