ts = 1340241300
import datetime
from dateutil import tz
dt = datetime.datetime.fromtimestamp(ts).replace(tzinfo=tz.tzutc())
dt
How do you create numpy.datetime64 object from a unix timestamp and set the timezone to UTC?