Skip to content

Instantly share code, notes, and snippets.

@adgedenkers
Created October 25, 2021 14:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save adgedenkers/68bacbb111ddd68a32ab7e2077edb907 to your computer and use it in GitHub Desktop.
# author: adge denkers @adge_denkers
# date: 2021-10-25
# file: func_get_timestamp.py
# ------------------------------------------------------------------------------
import datetime
import pytz
def get_timestamp():
eastern = pytz.timezone('US/Eastern')
now = eastern.localize(datetime.datetime.now())
ts = now.strftime("%Y-%m-%d %H:%M:%S%z")
return ts
print(get_timestamp())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment