Live data from Hacker News

Navigating the timezone nightmare in product development

getlago.com

61–65 of 65 posts

Re: Navigating the timezone nightmare in product development

#61
post #47

> And another fun fact (We had a lot of fun!): Time Zones often have a "friendly name" in the format Continent/City|Island except for UTC and... GMT+12, which only covers two uninhabited American islands :D There's quite a few other non-slash-having names out there: ls -pL /usr/share/zoneinfo | grep -v '/' "Eire" is in there, for instance, to deal with software that assumes that the "is_dst" half of the year is durin…

> GMT+12, which only covers two uninhabited American islands

New Zealand users are now mad at you :D

Re: Navigating the timezone nightmare in product development

#62

I recently joined a small online forum from my country. They had some people write the whole thing from scratch more or less. I happen to be traveling currently. When I log into the forum from my location, which is one hour away time zone wise from the country the forum is from, and I make a post, I then see the timestamp for my own post presented as “in 59 minutes”. I reported the bug, but they didn’t fix it yet. I…

What would you expect as a fix? How do they know about the timezone you are currently on? Not an easy fix in my opinion as they have to be aware of your timezone (or ask for it) anytime you post

Re: Navigating the timezone nightmare in product development

#63
post #36

Biggest thing we did with our hospitality related app (so check-in and check-out biggest time related fields): store time and date separately. Which I know isn’t possible in a lot of applications but whenever we only needed the date - we didn’t have to worry about timezones at all. Also working with dates, times and timezones inspired me to get an ISO8601 vanity plate for my car.

Indeed, this cannot be a solution for most of the business out there, as date and time are tied together to ingest a certain event. But this could be an easy fix for some businesses

Re: Navigating the timezone nightmare in product development

#64
post #4

It's solved, in that I'm never going to do better than zoneinfo and I'm not going to go crazy trying. https://en.wikipedia.org/wiki/Tz_database https://www.iana.org/time-zones I think of this as "difficulty snap back": Things can only get so difficult before everyone punts and uses some external library.

Timezones are not hard to build. It's indeed the interpretation of your app and the display to your end users that are hard to manage. Think of your birthday: it's not hard for you to set a datetime at your current location to define when your birthday starts. But the birthday wished from your friends might changed based on the interpretation they have and where they are located

Re: Navigating the timezone nightmare in product development

#65
post #62

I recently joined a small online forum from my country. They had some people write the whole thing from scratch more or less. I happen to be traveling currently. When I log into the forum from my location, which is one hour away time zone wise from the country the forum is from, and I make a post, I then see the timestamp for my own post presented as “in 59 minutes”. I reported the bug, but they didn’t fix it yet. I…

What would you expect as a fix? How do they know about the timezone you are currently on? Not an easy fix in my opinion as they have to be aware of your timezone (or ask for it) anytime you post

They are rendering the timestamp with JS.

JS has the ability to see system time zone offset.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

It’s not difficult to send the time zone in UTC, and convert it client side to local time zone.

And since they do “x minutes ago” kind of things they are certainly using a library. They are probably passing in “naive” timestamps without TZ info into a library that is perfectly able to handle it correctly for them, had they just read the docs for the library they used and taken a moment to make sure that they include TZ info.

And if everything was done server side it would likewise be similarly easy to get it right because then my own time zone does not matter.

Post reply on HN