1

I know this has been asked here several times, but the 'by-the-book' custom way to do it still remains unclear to me.

I'm designing an app which requires knowing the exact user's local-time. I got really confused while researching this:

Most experienced SO users recommend just asking the user for her timezone. Others recommend the Javascript timezone offset method. Another approach is to use geolocation.

Facebook posts and Gmail mails, for example, shows the exact local time, regarding DST and everything. I was never asked for my timezone by these applications. Which method might they use?

Or, among the above and other methods, which method is the custom, 'by the book' way to be able to use and store the user's local-time?

Community
  • 1
  • 1
Roy
  • 1,307
  • 1
  • 13
  • 29
  • Asking for their timezone is a little weird, geolocation is the best as far as user experience. You can pick up their location, and therefore, timezone on page load within PHP. – Nick Pickering Feb 24 '13 at 11:43

2 Answers2

3

In my opinion the best way is to ask the user to select their own timezone.

I always use geo-location to get the starting point, then ask the user to confirm which they require.

This allows the user the option of a quick, 'click to confirm' option, but still allows the user to change it if it isn't correct. Which is great for allowing for the fact that a user may be signing up/in from a location that isn't their own timezone, but they wish to se times/dates as though they were in their time zone.

This may not be the 'by the book' way, but I feel it gives the best user experience, which at the end of the day should always be the main priority!

j5Dev
  • 2,022
  • 14
  • 18
0

I have explicitly told Google what my timezone is, because my computer and I move around a lot, and I actually want two timezones, not just one (for Google Calendar). So I like that option. I think attempting to default to some reasonable guess using geolocation or similar might be better than just always assuming US EST or whatever, but once you've done it, consider storing the result for future use until the user explicitly changes it. It could be disorienting if it changes just because the user plugged in to a network that has bad geolocation (these do exist).

John Zwinck
  • 239,568
  • 38
  • 324
  • 436