4 ms·
They lost me at “ date time values without time zones.” This is rather useful for date of birth, which shouldn't be set to a time zone in most use cases (it ca
by below43 5y ago
They lost me at “ date time values without time zones.”
This is rather useful for date of birth, which shouldn't be set to a time zone in most use cases (it can get rather confusing if you do).
- filoeleven 5y agoEvery DOB field I’ve seen is just a date, with no timestamp at all.
- stevula 5y agoThere’s a footgun when you convert DOBs to Date objects. This can return different dates depending on the local timezone: ``` new Date("1/1/2021").toLocaleDateString() ``` If you want it to return the same DOB regardless of local timezone, you have to pass a timezone to the Date constructor, which is not super obvious. This kind of bug is also unlikely to get caught by unit tests unless you’re testing date formatting for different timezones, which you probably wouldn’t do if you’re not aware of the footgun to begin with.