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.

Time shift again

April 01, 2011 12:49pm

Subscribe [10]
  • #1 / Apr 01, 2011 12:49pm

    eeart

    257 posts

    Last year we had some big problems with times shifting, and today it happened again. We have an entry with a large matrix that has some 200 rows and each row has a start and end time. We had not had problems with this since November, but suddenly today upon saving this entry each time field shifted 1 minute back. So 2:00 PM became 1:59 PM etc.

    It is a pain to change all the fields back manually each time this happens. Last time we had this it had something to do with DST and it was a whole hour. Updating to the new version of EE fixed it then. This particular site is still on 2.1.1 but we have not updated this installation as everything was working fine and we have a lot of problems with 2.1.3 on another site.

    How can this suddenly happen without updating EE? Why would all the fields suddenly jump back a minute?

    I found this thread from 2009 (!): http://ellislab.com/forums/viewthread/113395/ but no solution given. This seems to be an ongoing thing.

  • #2 / Apr 01, 2011 12:51pm

    eeart

    257 posts

    PS: It also happened in normal Date fields in the same entry. So regular Date fields as well as Date fields inside Matrix shifted 1 minute back.

  • #3 / Apr 01, 2011 1:31pm

    eeart

    257 posts

    In CP you can’t see the seconds but when I looked at the timestamps of all these fields I noticed that everything ended with :16 seconds. So in fact instead of going back a whole minute everything had just gone back 44 seconds.

    I just ran a script to add 44 seconds to every matrix field in this entry and now they are good again.

    But the strangest thing is that when I keep an eye on the timestamps and save the entry several times in a row that each time the seconds change.

    For instance:

    1. Start with: Thursday 14th of April 2011 08:00:00 AM
    2. After save: Thursday 14th of April 2011 08:00:16 AM
    3. After save: Thursday 14th of April 2011 08:00:54 AM
    4. After save: Thursday 14th of April 2011 08:00:25 AM

    So the seconds are constantly jumping forward and back each time the entry is saved! You don’t notice this in CP because you don’t see the seconds, until it goes back or forward too much into the previous or next minute, and then suddenly you see the time is 07:59 or 08:01.

    I suppose that we hadn’t noticed this in the last few months because the seconds kept jumping within their correct minute.

    This is really bad. At any time saving an entry with all these times it can suddenly jump to another minute and I have to run my script to fix them all. It is really disappointing to keep running into these severe bugs, and when I browse the forum it seems that things like this have been going on for years. How is this possible?

  • #4 / Apr 02, 2011 2:25pm

    Greg Salt

    3988 posts

    Hi eeart,

    As for the time jumping back a minute (or what looks like a minute) there is a possibility that times can be rolled back by one second in order to make sure that a submitted entry date will actually be earlier that what is considered to be now by the localization class. This could change the submission minute (and therefore the hour). Where and how are you outputting the times you’ve given as an example above?

    Cheers

    Greg

  • #5 / Apr 02, 2011 2:31pm

    eeart

    257 posts

    I look at the timestamps in the database and display them on a page like this:

    echo date('l jS \of F Y h:i:s A', $value);
  • #6 / Apr 02, 2011 2:38pm

    Greg Salt

    3988 posts

    Hi eeart,

    Okay, so the seconds would naturally update in the time saved in the DB since they are saved with the entry_date. What I’m a little confused about is the jump back from :54 to :25 seconds in your example above. Are you saying that actually that last example should have been 08:01:25 i.e. the entry date is shown as 08:01 and displays as 08:00:25 on your template?

    Cheers

    Greg

  • #7 / Apr 02, 2011 3:52pm

    eeart

    257 posts

    Okay, so the seconds would naturally update in the time saved in the DB since they are saved with the entry_date.

    Why is this naturally? If I enter 08:00:00 in a Date field why would it ever change the seconds on saving? The timestamp should just stay the same.

    Are you saying that actually that last example should have been 08:01:25 i.e. the entry date is shown as 08:01 and displays as 08:00:25 on your template?

    No, the timestamp was 08:00:25 so in CP it looks normal as 08:00.

  • #8 / Apr 02, 2011 5:06pm

    Greg Salt

    3988 posts

    Hi eeart,

    What I meant was that the timestamp saved in the DB is accurate down to the second. If you save an entry with a date of 08:00:00 then that should be saved. Is that what you were doing, adding the seconds to the entry_date but the DB doesn’t reflect that? In testing on my local version 2.1.3 the time down to the second is reflected accurately in the entry_date timestamp. If that is not what you are seeing than it may be to do with the fact that you are on version 2.1.1. I would encourage to upgrade to the latest 2.1.3 or even the beta 2.1.4 if at all possible.

    Cheers

    Greg

  • #9 / Apr 02, 2011 5:08pm

    eeart

    257 posts

    I’m sorry if I wasn’t clear. This is unrelated to the entry_date.

    The entry has 2 custom Date fields and a Matrix with 200 rows with Date fields. The seconds in all these Date fields are shifting (the same amount of seconds) each time I save the entry.

  • #10 / Apr 02, 2011 5:31pm

    Greg Salt

    3988 posts

    Hi eeart,

    Ah, I see. Can you please test create a custom date field without Matrix and test save that entry and check the DB? Does that field change time in that way?

    Cheers

    Greg

  • #11 / Apr 02, 2011 5:52pm

    eeart

    257 posts

    Okay, I just created an empty new channel with a new Field Group that has only 1 custom field of type Date.

    I created one entry in this channel and selected date “2011-04-15 03:00 PM” (see the screenshot)

    After submitting new entry the value in exp_channel_data of this field is “1302897613”, which is 04/15/11 @ 3:00:13pm

    Then I opened and saved the entry 5 more times and each time took note of the timestamp in exp_channel_data:

    After saving 1st time: 1302897650 = 04/15/11 @ 3:00:50pm

    After saving 2nd time: 1302897628 = 04/15/11 @ 3:00:28pm

    After saving 3rd time: 1302897611 = 04/15/11 @ 3:00:11pm

    After saving 4th time: 1302897648 = 04/15/11 @ 3:00:48pm

    After saving 5th time: 1302897625 = 04/15/11 @ 3:00:25pm

    These times it always stayed within the minute 3:00, but I suspect that if I keep trying then eventually it will pop over to 2:59 or 3:01

  • #12 / Apr 03, 2011 3:31pm

    Greg Salt

    3988 posts

    Hi eeart,

    Hmm, that does seem to be odd. I’m going to put this in front of the rest of the team. Thank you in advance for your patience whilst we have a look at this.

    Cheers

    Greg

  • #13 / Apr 11, 2011 4:35pm

    eeart

    257 posts

    Any news on this? Thanks.

  • #14 / Apr 12, 2011 7:04am

    John Henry Donovan

    12339 posts

    eeart,

    I have pinged the devs on this one again

  • #15 / May 31, 2011 11:50am

    Stephen T

    127 posts

    Was there ever any news on this?  I have three custom date fields that I’m using for some events.  Sometimes these three date fields will move forward one minute, but not all the time and it doesn’t happen on all the entries.  For example, I have 5 entries for some events this weekend.  I went through and added something to all of these entries yesterday and only one of them moved all three date fields forward by one minute.  Another really odd thing is that the date fields don’t seem to be moving forward when I submit them.  After I submitted the entries yesterday, I double checked all of the entries and they were all correct, but this morning I started getting emails that the times listed were incorrect.

    I love EE, but the date and time issues I’ve had to deal with in EE 2 (mostly the one hour jump that is still occurring even though it’s been marked as fixed - https://support.ellislab.com/bugs/detail/15202/) are rather concerning and are causing a number of people in our office to lose faith in the system.

    I’m running EE 2.1.3 20110411.

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

ExpressionEngine News!

#eecms, #events, #releases