Remix.run Logo
omnicognate 3 days ago

No but we can and should store it as a timestamp with a timezone. It is rare for a nominal (date)time to be the correct thing to use. Please do read my other comment.

fauigerzigerk 3 days ago | parent [-]

>No but we can and should store it as a timestamp with a timezone.

It would be highly unusual and misleading to call something a timestamp unless it is a point in time. In Postgres for instance, the timestamp with timezone type represents an instant in time.

This data type cannot be used to store things like reminders for future appointments. It's not rare at all.

akio 3 days ago | parent [-]

That is not quite right. In Postgres, timestamptz (aka timestamp with time zone) represents an instant in time. timestamp (aka timestamp without time zone) represents what you are calling local time. timestamp (without time zone) is exactly what you should use to store future appointments.

Something that often trips people up is that they think timestamptz stores a timestamp plus a time zone (probably because of its unfortunate name). It does not; it always stores a Unix epoch without an extra time zone, converting any zoned timestamp that it is passed.

fauigerzigerk 3 days ago | parent [-]

Yes, you are right.