Assuming your string represents Unix time / seconds since 1970-1-1, it refers to UTC. You can convert it to datetime
like
from datetime import datetime, timezone
s = '1346114717'
dt = datetime.fromtimestamp(int(s), tz=timezone.utc)
print(dt.isoformat())
# 2012-08-28T00:45:17+00:00
Note that if you don't supply a time zone, the resulting datetime object will be naive, i.e. does not "know" of a time zone. Python will treat it as local time by default (your machine's OS setting).
To convert to US/Pacific time, you can use zoneinfo
from Python 3.9's standard lib:
from zoneinfo import ZoneInfo
dt_pacific = dt.astimezone(ZoneInfo('US/Pacific'))
print(dt_pacific.isoformat())
# 2012-08-27T17:45:17-07:00
or use dateutil
with older versions of Python:
from dateutil.tz import gettz # pip install python-dateutil
dt_pacific = dt.astimezone(gettz('US/Pacific'))
print(dt_pacific.isoformat())
# 2012-08-27T17:45:17-07:00
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…