1
8 Comments

How to reliably auto detect a user's timezone?

For a web app, I know that one reliable way is to ask the user to select their timezone when they sign-up and save that. Are there reliable ways to auto detect without asking the user, that you've used in your apps? (I've read SO and such, I know dealing with timezones is a tricky business, so I am looking to learn from other's experience! :)

  1. 2

    I use a trading platform that constantly shows your timezone at the bottom of the screen, warn you if it's not aligned with your device timezone and allow you to pick a different one.

    1. 1

      That makes a lot of sense. Thanks for sharing! Sounds like that is the consensus for the best reliable approach.

  2. 1

    I used JSTZ. If it wasn't detected properly, it would show a dropdown to the user. I don't think it ever actually failed for a regular user in ~4 years, though, so I would consider JSTZ to be reliable.

    Edit: Just wanted to add, if your service is timezone-dependant (like mine was), it's a good idea to check the timezone on each subsequent login, too, and then prompt the user to update their timezone information if they would like. This was crucial for our users who travelled. I think Google Calendar has a good example of this in action, too.

    1. 1

      Ah perfect this is the kind of experience evidence I was looking for! thanks! And yes my app is timezone sensitive as it's trying to track streaks and the midnight cutoff is important. Good point about checking on subsequent logins. I was trying to avoid asking the user but came to the conclusion that that actually gives user control (vs. burden them with having to select something from dropdown)

  3. 1

    Use any GeoIP service, and then show a undoable hint, something like "We've set your timezone to Europe/Berlin. <Change...>"

    Give a sane default, but most importantly, make it easy to change.

    1. 1

      Yeah sounds like you're saying that making it possible/easy for the user to change it is ultimately important. Agreed. Thanks!

  4. 1

    Any detection method you use is going to rely on the user's system being correctly configured. Granted, most users probably have "automatically set my time zone" turned on, but for the ones that don't, you'll have the wrong information.

    I think presenting the option to pick, and defaulting to your best guess is going to be the only way to accurately get that information. Even then, this is assuming the user has taken the time to correct the timezone if it happens to be incorrect.

    1. 1

      @joshtronic thanks for the thoughts! Yeah this is the reason it's tricky. Ultimately all auto-detect solutions are approximations (though in practice they might be correct 99% of the time).

Trending on Indie Hackers
Getting first 908 Paid Signups by Spending $353 ONLY. 25 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 12 comments Hero Section Copywriting Framework that Converts 3x 12 comments Promptzone - first-of-its-kind social media platform dedicated to all things AI. 8 comments