Skip to content

Instantly share code, notes, and snippets.

@JohnL4
Created July 10, 2020 16:52
Show Gist options
  • Save JohnL4/7f8af50a465b59a771dea2ef3447d211 to your computer and use it in GitHub Desktop.
Save JohnL4/7f8af50a465b59a771dea2ef3447d211 to your computer and use it in GitHub Desktop.
Converting epochs as given in jwt iat fields to human-readable timestamps
# PS S:\JLusk\Play\k6> python
# Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
# Type "help", "copyright", "credits" or "license" for more information.
from datetime import *
dt = datetime.fromtimestamp(1594396899)
dt.strftime( "%c")
# 'Fri Jul 10 12:01:39 2020'
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment