Skip to content

Instantly share code, notes, and snippets.

@AlexLamson
Created November 8, 2020 18:59
Show Gist options
  • Save AlexLamson/c069ace225837e55662d498744fc8b26 to your computer and use it in GitHub Desktop.
Save AlexLamson/c069ace225837e55662d498744fc8b26 to your computer and use it in GitHub Desktop.
My preferred way of getting a human-readable timestamp in python
from datetime import datetime
datetime.now().astimezone().strftime('%Y-%m-%d %H:%M:%S %Z')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment