ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

DST: Entries are posted one hour in the past

August 25, 2011 5:27am

Subscribe [3]
  • #1 / Aug 25, 2011 5:27am

    Simon Balz

    34 posts

    Hi All

    I’m actually having an issue concerning timestamps.

    When I create a channel entry, EE removes one hour from the timestamp.

    My settings in EE are:
    Timezone: UTC+1
    Server offset: 0
    Daylight saving: yes

    php.ini:
    date.timezone = “Europe/Zurich”

    When I check the server time via SSH, I get the time already with DST applied.
    So do I have to disable DST in EE when I already have a server-time which applies DST?

    When I check the timestamps directly in the database, they are correct.

    Cheers
    Simon

  • #2 / Aug 25, 2011 5:38am

    Simon Balz

    34 posts

    Additional info:

    EE Version 2.1.3 Build 20101220

    (Yes, it’s quite old, sorry for that).

  • #3 / Aug 25, 2011 5:50am

    Simon Balz

    34 posts

    Sorry, it’s me again and sorry for spamming.

    I created a template to compare EE and server time:

    ExpressionEngine
    {current_time format='%y-%m-%d %h:%i'}
    
    Server
    <?php echo date("y-m-d h:i",time()); ?>

    The EE time is actually one hour in past compared the server time.

    As I have seen some users with similar troubles and after they upgraded to EE2.2.2 with success, I’m asking myself if there is maybe any patch available for EE2.1.3?

    Update: We made a test-upgraded to EE2.2.2, and the problem still exists!

    Any help out there?

    Thanks
    simon

  • #4 / Aug 25, 2011 9:21am

    Stefan Rechsteiner

    442 posts

    Some Additional-Infos:

    ee current_time get’s me 01:13 while server is @ 02:13 (which is now/correct)
    If i change the timezone- and/or DST-settings in the EE CP nothing happens.
    If I post a new entry via SAEF/SafeCracker, the entry will be saved with an entry_date of 01:13 and will be immediately displayed on the frontend, while if I post a new entry via EE CP, the entry will be saved with an entry_date of 02:13 (now) and will NOT be displayed on the frontend (show_future_entries=off) … only when I change the entry_date to 01:13 (-1h from now) the entry will be shown on frontend.
    funny: in the database, the entries both have the same timestamp of 02:13 (now)

    … If I set the server-offset in the localization-settings of EE to «+60», the whole thing works more or less: EE current_time == server time == now … new entry-submitions via SafeCracker and CP do save and display correct … BUT: each and every entry in the ExpressionEngine-System will get one additional hour, which of course isn’t that nice … (the timestamp itself is not touched, it’s only the rendered time @ CP and frontend)

  • #5 / Aug 25, 2011 11:38am

    Derek Jones

    7561 posts

    Make sure the localization settings are correct not only for your server (including server time zone and DST) but also for your logged in user.  You should not need to set a server offset for hours - that’s only in the case that your server is off in increments of less than an hour, everything else should be based on the server’s actual location and time settings.

  • #6 / Aug 25, 2011 11:39am

    Stefan Rechsteiner

    442 posts

    Member Localization Settings are disabled

  • #7 / Aug 25, 2011 11:44am

    Derek Jones

    7561 posts

    What is the result of the following on the server?

    <?php echo date('T - e - I - O', time()); ?>

    And what is the server OS?  (Tools > Utilities > PHP Info, “Server”)

  • #8 / Aug 25, 2011 11:51am

    Stefan Rechsteiner

    442 posts

    CEST - Europe/Zurich - 1 - +0200 25.08.2011 16:49:40

    centos

  • #9 / Aug 25, 2011 11:58am

    Derek Jones

    7561 posts

    And to clarify - entries via Safecracker are entered with the correct current time, and through the CP they are advanced by one hour?  If I have that understanding correct, does the date picker for a new entry in the CP display advanced with that hour prior to submission, or is the date advancing only after submitting the entry?

  • #10 / Aug 25, 2011 12:02pm

    Stefan Rechsteiner

    442 posts

    SafeCracker: After submission, the entry_date is set 1 hour in the past (if now is 17:00, the safecracker-entry will have 16:00)

    EE CP: After submission, the entry_date is set the the actual time (if now is 17:00, the cp-entry will have 17:00) … BUT due to the ee-«current_time» is 16:00 instead of 17:00, the entry will not be published on the frontend for up to one hour (it’s a entry from the «future»)

    … therefore the Date-Picker in the EE-CP displays the correct time, also does the entry-listings in the CP and on the frontend via {entry_date}

  • #11 / Aug 25, 2011 12:52pm

    Derek Jones

    7561 posts

    That’s quite odd, Stefan.  Can you list for me your installed add-ons?  And this is on version 2.2.2 correct?  Version 2.1.3 definitely had bugs regarding dates and DST.

  • #12 / Aug 25, 2011 1:03pm

    Stefan Rechsteiner

    442 posts

    Assets, Channel Images, Channel Polls, Channel Ratings, Code Pack, Diskussionsforum, Favorites, Freeform, LibrarEE, SafeCracker, Simple Registration, Tag, User, Matrix, several PlugIns and Extensions as well as a couple of selfmade AddOns

    We’ve updated the EE2.1.3-System to EE2.2.2 today -> the problem still exists (Because there was another problem with ee2.2.2 (https://twitter.com/albuvee/status/106681854823903232) and we have to launch tomorrow morning (CEST), we’ve rolled back to the 2.1.3-backup — so we have only one problem 😉 )

  • #13 / Aug 25, 2011 1:13pm

    Derek Jones

    7561 posts

    On 2.1.3, you are definitely going to experience date bugs, and manual date manipulation would be your only option.  The fixes are complex and would require hacking a number of files.  On the other hand, I’m not aware of SafeCracker ever having been able to work with multiple channels, and a quick scan of the code doesn’t reveal that either.  Are you using a customized version?

    So, please let me know how you’d like to proceed, and we will do our best to help your launch go smoothly.

  • #14 / Aug 25, 2011 1:23pm

    Stefan Rechsteiner

    442 posts

    We definitely go with 2.1.3 (‘cause upgrading to 2.2.2 again and launch with it tomorrow without a extensive testing-phase would not be thaaat good, I think 😉 ). sooner or later we of course upgrade to the newest version, but right now, for the launch and for the next few days/weeks, we have to stick at v2.1.3.
    I’ve read about several date-bugs in 2.1.x, but we haven’t noticed any other bug on our system but this one (of course — what else? — just hours before lauch! 😉 )


    SafeCracker: stange, with our 2.1.3-installation safecracker has no problem with multiple channels inside the channel-parameter on an edit-form 😊

  • #15 / Aug 25, 2011 1:35pm

    Derek Jones

    7561 posts

    For expediency, Stefan, I’d like your permission to examine and make any modifications I might need to directly.  I would document the hacks for you, because that will be the only solution for you on 2.1.3.  Please let me know if that is acceptable to you, and if so please file out this form.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases