Last active
December 18, 2021 15:14
-
-
Save xjxckk/c432e661faaf8567f35b32ce5e334897 to your computer and use it in GitHub Desktop.
Python datetime, use strftime.org as a reference
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 | |
date = 'Sat Nov 13 11:54:30' | |
date = datetime.strptime(date, '%a %b %d %H:%M:%S') # Sat Nov 13 11:54:30 | |
date = date.strftime("%Y-%m-%d, %H:%M:%S") # 2021-11-13, 11:54:30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment