3 ms·
There is .utcfromtimestamp(). The problem is that this function returns a naïve datetime. You don’t need to grab in a library, though. There is a UTC zone defi
by klodolph 2y ago
There is .utcfromtimestamp(). The problem is that this function returns a naïve datetime.
You don’t need to grab in a library, though. There is a UTC zone defined in the standard library. You pass it in as the second argument to .fromtinestamp():
datetime.fromtimestamp(ts, UTC)