Skip to content

Instantly share code, notes, and snippets.

@chrisvoncsefalvay
Created March 9, 2021 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvoncsefalvay/12b44139e3233099c73c92a94d640456 to your computer and use it in GitHub Desktop.
Save chrisvoncsefalvay/12b44139e3233099c73c92a94d640456 to your computer and use it in GitHub Desktop.
DTG formatting in Python
from datetime import datetime
t = datetime.now()
tstring = f"{t.day:02}{t.hour:02}{t.minute:02}{t.strftime('%b').upper()}{t.year}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment