Skip to content

Instantly share code, notes, and snippets.

@apfister
Created March 29, 2023 23:35
Show Gist options
  • Save apfister/95df4aad1a6416eff7870ab29352b25b to your computer and use it in GitHub Desktop.
Save apfister/95df4aad1a6416eff7870ab29352b25b to your computer and use it in GitHub Desktop.
convert a timestamp value to a string
from datetime import datetime
ts = 1546734359
n = datetime.fromtimestamp(ts)
date_formatted = n.strftime('%Y-%m-%d %H:%M:%S')
# print(date_formatted)
return date_formatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment