1. Jon Nylander
  2. jsTimezoneDetect
  3. Issues

Issues

Issue #15 wontfix

Misleading timezone

Anonymous created an issue

Hi Your script works very well for me, although it can be misleading for users, because of fact, that one timezone may represent time for another timezones. So, for example: User who lives in Poland (Europe/Warsow) will see Europe/Berlin. The time will be correct, but the user may think that his timezone was detected incorrectly. So, is there any way to create similar script, but which will be showing real timezone?

Comments (4)

  1. Jon Nylander repo owner

    Hello and thank you for your feedback.

    I completely understand what you mean and what you suggest is what I actually started out doing. Using the Javascript Geolocation API it would be possible. However, many browsers do not support the GeoLoc API, which would leave you with IP based information (which is not all that reliable). The Javascript Geolocation API also requires the user to give his/hers consent before it can retrieve any information. Personally, I did not want that hurdle.

    (There are IP based geoloc APIs out there that will actually give you a direct timezone result. But the client should have the last say since any single user's IP may in fact be from a computer in a different timezone)

    I narrowed my scope to a pure Javascript solution which would be able to sort out all "unique" modern timezones. I wanted it to be reliable and work the same across browsers and operating systems. The timezones that the script returns are great for datetime operations, not for direct display to a user.

    If you want further exactness for the sake of user experience, I suggest:

    1. Asking the user to correct the assumption the script has made, perhaps in a user settings page.
    2. Extend the script to use either Geolocation and/or IP based geolocation and automatically give a more exact timezone.
  2. Anonymous

    Hi. I am currently working on adjusting your script to my project and have similar problem (misleading the user with name of timezone). I came up with one solution and would love to hear what do you think about it.

    According to your Wiki: Europe/London, also represents Europe/Lisbon, Europe/Dublin, Atlantic/Canary, Atlantic/Madeira, Atlantic/Faroe, Europe/Isle_of_Man, Europe/Jersey and Europe/Guernsey

    So, we can use timezone's abbreviations (in this case BST) and show it to user instead of Europe/London. Thanks to this move, user will not think that his timezone was detected incorrectly.

    There is only one question - Does every group of timezones (like this one above) fit to only one abbreviation?

  3. Jon Nylander repo owner

    No, every group of timezones (as detected by this script) does not have one abbreviation. BST for example stands for British Summer Time if I am correct. So it would not really make sense for a citizen of Portugal.

    The easiest way, in my view, to fix this "problem" is the following example. We have two timezones in the 0 offset. Make sure that users can select them in a dropdown perhaps like this:

    1. UTC+0 - London, Lisbon, Dublin, Madeira, Jersey, Guernsey
    2. UTC+0 - Casablanca, Abidjan, Dakar, Accra, Conakry, Ouagadougou, Bamako, Reykjavik

    When abbreviating, simply use the UTC offset. It will make sense for the individual users, in most cases.

    /Jon

  4. Anonymous

    Thank you for replay.

    I thought about using UTC offsets, but then I would have to program changing timezone of user for every single time change (DST). For example: UTC+1:00 in half year should be changed to UTC+2:00 in some timezones.

    However, thank you for your help and suggestions.

  5. Log in to comment