Created
February 6, 2020 15:42
-
-
Save momota/08c170ce9f804d96ea0d3aee5edb3bb7 to your computer and use it in GitHub Desktop.
get datetime with 0 padding
This file contains hidden or 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() | |
now_str = now.strftime('%Y-%m-%d-%H-%M') | |
year, month, day, hour, minute = now_str.split('-') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment