Skip to content

Instantly share code, notes, and snippets.

@slackorama
Created September 29, 2011 22:56
Show Gist options
  • Save slackorama/1252171 to your computer and use it in GitHub Desktop.
Save slackorama/1252171 to your computer and use it in GitHub Desktop.
Get year, month and day from a python date object.
year = time.strftime("%Y", sampledate)
month = "%02d" % int(time.strftime("%m", sampledate))
day = "%02d" % int(time.strftime("%d", sampledate))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment