• Resolved 1earthsangha

    (@1earthsangha)


    Perhaps I’m misunderstanding the intent of your calculator. My need is simple, just show the time for an event in the website visitor’s local time. The visitor is likely not a wordpress user. I don’t need a list of timezones, just the one that applies to the visitor where they are. Here’s the short code that I’m using but it always shows the time in UTC.

    [timezonecalculator_output query_time=”Sun, 13 Sep 2015 14:30:00″ query_timezone=”America/New_York”]
    Result: 2015-09-13 06:30 pm UTC
    Because I’m in the New York timezone, expected Result: 2015-09-13 02:30 pm America/New York

    I’ve tried many different settings on the admin options to no avail.

    Thank you for any help.
    Kristin

    https://www.ads-software.com/plugins/timezonecalculator/

Viewing 1 replies (of 1 total)
  • Plugin Author Bernhard Riedl

    (@neoxx)

    Hi Kristin,

    Guessing the user’s timezone could be quite challenging and might not deliver accurate results, for example if the user’s connected via a VPN or Proxy Server. Anyway, afaik, there are some databases on the Internet to map IPs with timezones, but I haven’t tested any of them, though I would only use them to suggest a timezone, for example like Google does with their calendar.

    If you want to make sure that you get the user’s timezone right, I recommend to ask via a select – as it’s done in WordPress Admin Menu, page ‘Settings/General’ – or use a text-input with a datalist-field to store the user’s choice in a cookie. It’s then possible to use TimeZoneCalculator to output either the current time or a specific timestamp (e.g. start-date of event) for an anonymous / non WordPress user in her/his timezone.

    Regarding your example, I think you got the query_timezone and timezones attributes mixed up. – Please have a look at the Other Notes section for detailed information.

    Here’s your example with two timezones,

    [timezonecalculator_output query_time="Sun, 13 Sep 2015 14:30:00" query_timezone="America/New_York" timezones="America/New_York\nEurope/Vienna"]

    … and that’s how you can setup a shortcode for a current timestamp in a specific timezone if you don’t want to use the selection of TimeZoneCalculator’s settings-page.

    [timezonecalculator_output timezones="America/New_York"]

    Hope that helps.

    My Best,
    Berny

Viewing 1 replies (of 1 total)
  • The topic ‘Show event time in website visitor's local time’ is closed to new replies.