Comment

Comment by amluto

> # The local system timezone > LocalDateTime,

Here’s my feedback: one should essentially never use “local” time. I would even argue that the existence of systemwide local time is a historical mistake.

Why would you ever want to use the “local” timezone of the system on which you are running? If the user is literally sitting in front of a monitor plugged in to the machine, it might be appropriate (but it should be a per-user setting). But if the user is using X forwarding or ssh or a remote desktop, you have no idea what timezone the user is in. (And this was common in the mainframe era!) If you’re servicing a request over the network, you don’t want local time.

The only sort of legitimate use for “local” time I can think of is compatibility with libc and it’s horrible time API.

You can’t even tell what local time means without getenv, which is a footgun.

So maybe LocalDateTime should be called LibcCompatLocalDateTime.

parent amluto 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton