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.

I need help understanding the entry_date field

January 02, 2010 8:31pm

Subscribe [7]
  • #1 / Jan 02, 2010 8:31pm

    SSM

    33 posts

    So, at roughly 11:57pm EST on 1/2/10 I made an entry. Looking in the database the entry_date field has:

    1262516240

    which corresponds to:

    GMT: Sun, 03 Jan 2010 10:57:20 GMT
    EST timezone: Sun Jan 3 05:57:20 2010

    which is clearly wrong. So, that is weird. What makes it worse is that my server is in TX and I have my sys pref set to GMT -6:00 (CST).  My local settings are GMT -5:00 (EST). Now, when I look at the human readable entry date in the “edit” form - it shows:

    01/02/10 11:57 pm

    which is correct. How can that be? The timestamp is clearly wrong by every server converter I checked.  It is off by 6 hours… but it still gives me the right time?

    Can anyone sort this out?

    I’m using v1.6.4

  • #2 / Jan 02, 2010 9:47pm

    SSM

    33 posts

    deleted

  • #3 / Jan 03, 2010 10:40am

    SSM

    33 posts

    After posting multiple tests - there is indeed a 6 hour difference between the time stamp in entry_date and the human readable time being reported to me by EE.

  • #4 / Jan 03, 2010 2:41pm

    Greg Salt

    3988 posts

    Hi SSM,

    If I understand correctly you have set the system time to be CST (GMT -6:00) because your server is in TX? That’s not necessarily required. What time is your server set to (your host should be able to help with this)? Try changing your system prefs time to GMT.

    Cheers

    Greg

  • #5 / Jan 03, 2010 3:40pm

    SSM

    33 posts

    My system time is indeed correct on the server.

    [root@www /]# date
    Sun Jan 3 13:36:04 CST 2010

    Setting the system localization to 0 GMT did not have any effect. I wouldn’t expect it to since that should just be altering the times to a default setting if logged in members didn’t set their own time.

    Any other ideas?

    If I manually put in the right unixtime for “now” - it will tell me that the time is 6 hours earlier. I have double checked my own localization settings.

  • #6 / Jan 04, 2010 8:09am

    Sue Crocker

    26054 posts

    SSM, is it possible to upgrade to the most recent version of EE? You’re running a fairly old version.

    When you’re testing these settings, are you logged into the front end?

    Add the following code to your test page:

    {if logged_in}
    You're logged in.
    {if:else}
    You're not logged in.
    {/if}

    Are you getting the results you expected?

  • #7 / Jan 04, 2010 8:55am

    SSM

    33 posts

    SSM, is it possible to upgrade to the most recent version of EE? You’re running a fairly old version.

    When you’re testing these settings, are you logged into the front end?

    Add the following code to your test page:

    {if logged_in}
    You're logged in.
    {if:else}
    You're not logged in.
    {/if}

    Are you getting the results you expected?

    Yes, I’m logged in. I’m viewing the dates from the admin panel.

    What concerns me the most are the inaccurate GMT timestamps. That might be hard to fix. What baffles me the most is the correct time being pulled from those stamps.

    I figured something like this would have had to be a known bug.

  • #8 / Jan 04, 2010 9:33am

    Sue Crocker

    26054 posts

    https://support.ellislab.com/bugs/detail/6111/

    Does this sound like the bug? Again, please upgrade to 1.6.8 so we’re on the same code base for testing.

  • #9 / Jan 05, 2010 12:35am

    SSM

    33 posts

    https://support.ellislab.com/bugs/detail/6111/

    Does this sound like the bug? Again, please upgrade to 1.6.8 so we’re on the same code base for testing.

    it is not.

    I upgraded to 1.6.8 and made anew entry. The unixtime stamp in entry_date is:

    1262687164

    which is:

    GMT: Tue, 05 Jan 2010 10:26:04 GMT
    Your timezone: Tue Jan 5 05:26:04 2010

    according to: http://www.epochconverter.com/

    I made that post on: Mon Jan 4 11:26:04 2010

    It is a 6-hour difference. It has to be the way my server is setup and how the script interacts with it. It seems too much of a coincidence not to check that 1st.

    When I run “date” it gives:

    Mon Jan 4 22:33:16 CST 2010

    which is correct as I type. I’m running Centos 5.x

  • #10 / Jan 05, 2010 12:44am

    SSM

    33 posts

    if I run:

    date ‘+%s’

    I get:

    1262666555

    GMT: Tue, 05 Jan 2010 04:42:35 GMT
    Your timezone: Mon Jan 4 23:42:35 2010

    which is correct…

  • #11 / Jan 05, 2010 7:09pm

    Adam Dorsey

    1439 posts

    What are your localization settings?

    Found at: My Account ›  Localization Settings

  • #12 / Jan 05, 2010 9:03pm

    SSM

    33 posts

    as mentioned in the original - post -5 EST for my account. -6 CST for the default setting. That still doesn’t explain incorrect timestamps being put in the database.

  • #13 / Jan 06, 2010 7:20pm

    SSM

    33 posts

    Still struggling with this…

  • #14 / Jan 06, 2010 7:21pm

    Adam Dorsey

    1439 posts

    If you go to: My Account ›  Member Administration

    Click on your account, and go to Membership preferences, do you have “Use this member’s localization settings as the master site default?” checked?

  • #15 / Jan 06, 2010 8:50pm

    SSM

    33 posts

    No it wasn’t checked. I checked it. Made a post - and it made no difference.

    I’m not really sure where you are going with this, but a single line reply a day is getting frustrating.

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

ExpressionEngine News!

#eecms, #events, #releases