Last active
December 15, 2019 10:00
-
-
Save jigewxy/654f1539a09ee8c5c3da9a33ec0b8ab1 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
import datetime | |
now = datetime.datetime.now() | |
print(now.strftime('%Y-%m-%d-%H-%M-%S')) | |
print(now.strptime('09/19/18 13:55:26','%m/%d/%y %H:%M:%S')) | |
# strftime convert time to string format; strptime convert string to given format. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment