Live data from Hacker News

You're Wrong About Dates – and Your Code Is Lying to You

metaduck.com

21–22 of 22 posts

Re: You're Wrong About Dates – and Your Code Is Lying to You

#22
post #4

I forget where I first heard it, but "Dates are not real. Only times with zones are real." When you need to be precise, you specify a time and a zone. When your application has users in different geographies, you need to be precise. Displaying the date attached to a time is a presentational convenience. Only the time is real.

Example of dates not being real:

You celebrate your birthday on January 5th, whether you're in Hawaii or New Zealand.

You might get texts from friends & family earlier and later than that.

Outlook had a funny bug where when you stored a birthday on a certain date (which is then an all-day event), it would shift that all-day event by x-hours when you changed timezones.

Post reply on HN