Created
October 25, 2021 14:15
-
-
Save adgedenkers/68bacbb111ddd68a32ab7e2077edb907 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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