Last active
August 29, 2015 14:06
-
-
Save walterrenner/7134d5407c6a1781bb1f to your computer and use it in GitHub Desktop.
Common Python datetime formatting strings
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
# A complete list of available directives id available on: | |
# https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior | |
from datetime import datetime | |
now = datetime.now() | |
print now.strftime('%d. %b %Y') # 17. Sep 2014 | |
print now.strftime('%d.%m.%y') # 17.09.14 | |
#"%D %d %M %Y" -> 'Wed 09 Jan 2008' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment