Hacker News new | ask | show | jobs
by JSR_FDED 7 days ago
Small nit: uuid7 is 128 bits (16 bytes) by definition. So there’s no need to convert it to binary. It already is. Unless you’re working with a stringified version of the uuid7.
1 comments

Oh yes, I meant don’t store as an ID in its string format!
It's just s dumb as storing dates as strings, but people still do it.
But SQLite does not have a native datetime type so you have to use strings
You can use an integer
How do I know the time zone of an integer? Sure there are plenty of cases where one doesn't care, but there are also many cases where the original time zone is important.
The integer is a UTC time so it can be sorted. If you need the time zone you store than in a smaller field.
other comment said it already, timezone information is not saved. Easiest is just to use a string.
But also one of the recommended ways of doing it, as it has no native Datetime type.