Comment

Comment by 22c

I'd say the main issue here is that in the article, we have

> ts = 1571595618.0

This a timestamp, there is no TZ data required.

> x = datetime.utcfromtimestamp(ts)

Now for some reason the developer cares about UTC all of a sudden?

If the developer doesn't care about the TZ, they should use:

datetime.fromtimestamp(ts)

parent 22c 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton