SyntaxFix
Write A Post
Hire A Developer
Questions
A simple (but maybe flawed) way that works in Python 2 and 3:
import time import datetime def utc_to_local(dt): return dt - datetime.timedelta(seconds = time.timezone)
Its advantage is that it's trivial to write an inverse function