Skip to content

Instantly share code, notes, and snippets.

View deeplook's full-sized avatar

deeplook

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deeplook
deeplook / timestamp.py
Last active October 26, 2021 07:00 — forked from ju-popov/timestamp.py
Python DateTime / Timestamp Conversion
######################################################################
# CURRENT AWARE LOCAL DATETIME
######################################################################
from datetime import datetime
from tzlocal import get_localzone # pip install tzlocal
local_tz = get_localzone()
local_dt = datetime.now(local_tz)