Skip to content

Instantly share code, notes, and snippets.

@koolquark
Created July 7, 2018 07:47
Show Gist options
  • Save koolquark/19cd03542bb08ec3078adb73a8a9f026 to your computer and use it in GitHub Desktop.
Save koolquark/19cd03542bb08ec3078adb73a8a9f026 to your computer and use it in GitHub Desktop.
Python time - now in strftime
from datetime import datetime
now = datetime.now()
print(now.strftime("%Y-%m-%d-%M__%H-%M-%S"))
# >>> from datetime import datetime
# >>> now = datetime.now()
# >>> print(now.strftime("%Y-%m-%d-%M__%H-%M-%S"))
# 2018-07-07-47__07-47-00
# >>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment