zck 3 hours ago

One place I've been bitten lately is storing timestamps in Postgres. Postgres lets you store time with a time zone -- but what that means is that upon receiving a timestamptz converts it to UTC and stores that instead.

Which is fine, in a way -- it won't store the wrong instant in time. But it also won't let you know the time the user sees. For example, you might want to tell someone when the store opens.

Fine, you say. You can look up the location of the store and use that to get the timezone. But what about a different case? What about if you want a user to test their blood sugar every day. Did they test their blood sugar on Tuesday? Well, then it depends what timezone they're in. What is the problem with having each user set their time zone? Isn't this just like the store issue?

No! Notably, unlike stores located in fixed buildings, people move around. They go on vacation. And if you don't know where they were when an event happened, you don't know what time the user was.

So it seems you have to, when you get a timestamp with time zone from a user, store the timestamptz, but also store the time zone in the database.

How frustrating, for a database that has a data type called "timestamp with time zone".

notepad0x90 an hour ago

I just wanna say bravo and great job on the web design. A web page that actually fills up my entire screen with content. Even though the margins are mostly unused, pictures and tips still show up there once in a while. Even on HN, I see something like a 20% margin just wasting space.

lcnPylGDnU4H9OF 2 hours ago

Learning the story of During via this 7 year-old blog post is poetic:

> Sometimes we’d be working on something that tangentially related to time, and as kind of a recurring in-joke he’d always tell me: Zach, whatever you do: just don't ever build a calendar.

> Anyway, I’m Zach Holman and I’m [building a calendar](https://during.com).

> During is no longer a thing.

Good on them for trying.

skullone 3 hours ago

Lots of words to say "use already available time libraries and use ISO time formatting". Cool story bruh. And really really terrible way to communicate one of the most beaten to death categories with that site design

  • crote an hour ago

    Most time libraries - especially the stdlib ones - are broken in various subtle ways. ISO time formatting is neat, but only works for past events.

    Your approach is usually going to be sufficient-ish for timestamping past events - which is most applications. But try to build a calendar, and you'll quickly notice that it simply doesn't work that way.