Event Start/End times incorrect for USA

Posted on
  • Starting to use Event features, and have noticed that when I try and set up a start/end time to 10am-2pm, it comes out as 6pm-10pm....looks like the GMT(London, England) versus PDT (Portland, Oregon,USA)...I tried a number of times, using Edit Event, to change it, but it's fairly consistent.

    See: http://forum.pwtc.com/events/395/

    Thanks for any help!

  • That seems like an obvious bug, I'll push it to the top of my todo list.

    Yes, the events store the date in UTC, which happens to be the same as GMT.

    It would appear that whilst I thought the code detected the offset of the web browsers' clock and saved the correct UTC, that it does not.

    I'll revisit the code now. I suspect I'll have to make a few changes to fix this.

  • I have fixed the display of times.

    However, editing an event currently resets the form to UTC, so I will address that next.

  • Oh, and the way this works... we still render HTML giving the UTC information as this provides metadata to Google and other search engines so that things like this eventually happen (when you have enough events): https://www.google.com/search?q=site:htt­p://www.lfgss.com+type:event

    In theory, we tell Google that this is all UTC, and Google shows search results in the local time zone to their users... which means they'd see the correct local time.

    What that means is that we need to work out the local time of the person looking at the page and change how we present the dates and times so that it's correct for them.

    We do that with JavaScript... reading the UTC time, and then asking JavaScript to tell us the date and time according to the browser locale, which should be derived from the system locale.

    So... as long your clocks on your computer are right (with your local timezone) then the correct time is shown.

  • I've now fixed the editing of events too, though this updated a JavaScript file and you may have to CTRL+F5 or the equivalent to see the latest version.

  • David,
    Ok! Seems to work fine now!
    Thanks for the quick-fix.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Event Start/End times incorrect for USA

Posted by Avatar for ajjcoppola @ajjcoppola