Created
June 22, 2013 14:58
-
-
Save vanzaj/5841176 to your computer and use it in GitHub Desktop.
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 | |
now = datetime.now() | |
codes = [ | |
r'%Y-%m-%d %H:%M:%S', | |
r'%a %b %d %H:%M:%S', | |
r'%A %B %d', | |
r'%c', | |
r'%x %X %z %Z', # locale's date & time, UTC offset and timezone | |
] | |
print '%17s : %s' % ('code', 'result') | |
print '-'*17, ':', '-'*17 | |
for c in codes: | |
print '%17s : %s' % (c, now.strftime(c)) |
Author
vanzaj
commented
Jun 22, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment