All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Events Time Zone..

Marc Addeo 30 Dec 2013 22:13 question, complete

So, I've got an event that is supposed to take place on December 7th, 2013 at 3pm to 6pm.

In the database, it's stored as 2013-12-07 for the start_date, 15:00:00 for the start_time, 2013-12-07 for the end_date, 18:00:00 for the end_time.

When I do {event_date:start_stamp} it outputs 1386428400. When I do {event_date:end_stamp} it outputs 1386439200.

Both of the timestamp values are incorrect. They're both off by 5 hours, and I'm not really sure why.. I've got my EE's timezone set to America/New_York from within the localization settings in the panel, not sure if it gets overwritten somewhere else within Low Events' code or something though.. America/New_York is GMT -5, which lines up to the 'missing' time but I'm not sure how/why it's 'missing'...

Any ideas on this? It's quite a problem.. And I'm not sure how to properly fix it.. If I add 5 hours to each value, I believe they'll be inaccurate due to daylight savings and etc..

Replies

  1. Low 30 Dec 2013 22:28

    Low Events uses the server time as its base. At the moment, that's not configurable. Perhaps you could change the timezone on your server itself.

  2. Marc Addeo 30 Dec 2013 22:31

    Could you point me to the file/line/method that generates those timestamps? I'd like to set a breakpoint before it to test what the current timezone is actually set to on my server.. I assume I can just set_default_timezome (or whatever the function is) in my config file to my timezone, and want to be sure it carries through and doesn't get overridden somewhere down the line.

  3. Low 30 Dec 2013 22:43

    I'm actually away for New Years at the moment, so my support is somewhat limited until Jan 2nd.

    The time zone isn't set anywhere explicitly in Low Events, so it won't be overwritten anywhere either. It just uses default server settings, regardless of EE.

  4. Marc Addeo 30 Dec 2013 22:52

    No problemo! Will have to do some debugging, hopefully just setting the timezone in my config file should fix it..

  5. Marc Addeo 31 Dec 2013 14:32

    Hmm, so setting the default date time in my config file didn't solve the issue :/ So it seems like somewhere else in EE it gets overwritten..

    Could you point me in the right direction as to which file to look in for that start_stamp and end_stamp. I know you said you're away, so a guess is fine too :)

  6. Marc Addeo 31 Dec 2013 14:57

    Ended up finding where that code is located and found a fix. The code itself was in the field type file, and in order to fix it i had to:

     
    $config['default_size_timezone'] = 'UM5'; // America/New_York
    $config['allow_member_localization'] = 'n';


    Now all is working. It seems no matter what I set it to in the localization settings in the backend, it would always be UTC.. Not sure why! These hidden config files override is completely.

  7. Low 2 Jan 2014 12:04

    Cool, glad you got it working.

  8. TechNinja 21 Sep 2016 20:03

    is there a way to show events based on the user localization settings ?

  9. Low 21 Sep 2016 20:11

    Not at this moment. Low Events was purposely designed with no localization in mind.

  10. TechNinja 21 Sep 2016 20:25

    hmm. i'm stumped.

    is there one place where low events gets the time from ? how complicated would it be to hack this function to get the time zone from the user and offset the events based on that ?

  11. Low 21 Sep 2016 20:35

    Low Events uses its Low Events Date library for most of its date calculations. Not sure how complicated it would be -- it wouldn't be a case of altering one line and done, for sure -- and not really something I can support. But you might be able to work around it by setting the time zone PHP works with to the user's time zone before Low Events is called.

  12. TechNinja 21 Sep 2016 20:38

    thanks for the tip, i'll get on it!