def standard_date(dt):
    """Takes a naive datetime stamp, tests if time ago is > than 1 year,
       determines user's local timezone, outputs stamp formatted and at local time."""
now = datetime.utcnow()
diff = now - dt
if diff.days / 365 >= 1:
    fmt = "%b %d '%y @ %I:%M%p"
else:
    fmt = '%b %d @ %I:%M%p'
users_tz = tz.tzlocal()
utc_dt = dt.replace(tzinfo=pytz.utc)
loc_dt = utc_dt.astimezone(users_tz)
f = loc_dt.strftime(fmt)
return f
How to, with python, take a UTC datetime, autodetect users timezone, and convert the datetime to desired format?