Last active
January 15, 2018 19:55
-
-
Save joonro/7d19b537f77594f8ca923782da04a1f7 to your computer and use it in GitHub Desktop.
[Convert datetime to string using type-specific formatting] https://docs.python.org/3.6/library/string.html #python #date #string
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
>>> import datetime | |
>>> d = datetime.datetime(2010, 7, 4, 12, 15, 58) | |
>>> '{:%Y-%m-%d %H:%M:%S}'.format(d) | |
'2010-07-04 12:15:58' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment