Skip to content

Instantly share code, notes, and snippets.

View deeplook's full-sized avatar

deeplook

View GitHub Profile
Loading
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 September 30, 2024 17:48 — 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)