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.

Changing Server Time Zone Isn't Working

October 19, 2010 11:45pm

Subscribe [5]
  • #1 / Oct 19, 2010 11:45pm

    jtree

    255 posts

    I’m working on a new site and noticed the times were an hour behind.  I checked the Server Time Zone and it is set correctly (Eastern Standard Time) and there is nothing entered in the “Server Offset” and “Daylight Savings Time” is set to “No”.  I’ve tried changing the “Server Time Zone” to something totally different and it doesn’t change anything.

    I’ve also checked to make my “Member Administration” and it is set correctly (Eastern Standard Time) and “Use this member’s localization settings” is not checked.  There’s only one other member on the site and I’ve checked their settings as well and it is the same as mine.

    I’m running 1.7.0, Build 20101018.  Thanks!

  • #2 / Oct 20, 2010 10:00am

    Sue Crocker

    26054 posts

    What about DST Active on Date of Entry? Is that checked for the entry? Are you logged in when you attempt to view the site?

  • #3 / Oct 20, 2010 7:14pm

    jtree

    255 posts

    I’m not even publishing new entries, although the time is off there too.  I’ve just entered {current_time format="%g:%i %a"} into my template.

    Both when I’m logged in and logged out it shows the time as an hour behind.

  • #4 / Oct 21, 2010 9:35am

    Sue Crocker

    26054 posts

    If you add %T to your test, are you seeing the right time zone there? I suspect that’s where the issue lies.

  • #5 / Oct 21, 2010 11:05am

    jtree

    255 posts

    I’ve added it and it says “EST”

  • #6 / Oct 22, 2010 3:33am

    John Henry Donovan

    12339 posts

    jtree,

    Can you create a blank template and turn on PHP and add the following please. let us know the results.

    <h1>Test of various time/date functions:</h1> 
    
    <h3>Server</h3><p> <br />
    PHP date: <?php echo date('dMy h:i');?>(echo date('dMy h:i');)<br />
     <br />
    PHP gmdate: <?php echo gmdate('dMy h:i');?>(echo gmdate('dMy h:i');)<br />
     </p>
    
    <h3>Database dates(GMT/UTC)</h3><p> <br />
    LOC now: <?php global $LOC; echo 'held in db as '.$LOC->now; echo ' which is '.date('dMy h:i',$LOC->now); ?> (date('dMy h:i',$LOC->now);)<br />
     </p>
    
    <h3>User</h3><p> <br />
    Users timezone: <?php global $SESS; echo $SESS->userdata['timezone'] ; ?> ($SESS->userdata['timezone'])<br />
     <br />
    Users Time:<?php global $LOC; echo $LOC->set_human_time(); ?> ($LOC->set_human_time();)<br />
    

  • #7 / Oct 25, 2010 6:56pm

    jtree

    255 posts

    Test of various time/date functions:
    Server
    PHP date: (echo date(‘dMy h:i’);)
    PHP gmdate: (echo gmdate(‘dMy h:i’);)
    Database dates(GMT/UTC)
    LOC now: now; echo ’ which is ‘.date(‘dMy h:i’,$LOC->now); ?> (date(‘dMy h:i’,$LOC->now);)
    User
    Users timezone: userdata[‘timezone’] ; ?> ($SESS->userdata[‘timezone’])
    Users Time:set_human_time(); ?> ($LOC->set_human_time();)

  • #8 / Oct 25, 2010 7:04pm

    Sue Crocker

    26054 posts

    jtree, did you turn on PHP in input mode for this test?

  • #9 / Oct 25, 2010 7:09pm

    jtree

    255 posts

    Whoops - sorry!

    Test of various time/date functions:
    Server
    PHP date: 25Oct10 05:08(echo date('dMy h:i');)
    PHP gmdate: 25Oct10 10:08(echo gmdate('dMy h:i');)
    Database dates(GMT/UTC)
    LOC now: held in db as 1288062520 which is 25Oct10 10:08 (date('dMy h:i',$LOC->now);)
    User
    Users timezone: UM5 ($SESS->userdata['timezone'])
    Users Time:2010-10-25 05:08 PM ($LOC->set_human_time();)
  • #10 / Oct 26, 2010 5:49pm

    Ingmar

    29245 posts

    This test, at what local time did you run it? Also, when you add a server offset in your configuration, does that change anything?

  • #11 / Oct 26, 2010 7:59pm

    jtree

    255 posts

    I ran the test at 4:08pm

    I tried adding and subtracting from the server offset and it had no effect.

  • #12 / Oct 27, 2010 10:18am

    Sue Crocker

    26054 posts

    .. which for some reason is showing as 05:08 instead of 04:08. I don’t know what’s causing this, I can’t replicate it on my 1.70 install.

    Server
    PHP date: 27Oct10 06:16(echo date('dMy h:i');)
    PHP gmdate: 27Oct10 01:16(echo gmdate('dMy h:i');)
    Database dates(GMT/UTC)
    LOC now: held in db as 1288210594 which is 27Oct10 01:16 (date('dMy h:i',$LOC->now);)
    User
    Users timezone: UM6 ($SESS->userdata['timezone'])
    Users Time:2010-10-27 08:16 AM ($LOC->set_human_time();)
  • #13 / Oct 29, 2010 5:52pm

    jtree

    255 posts

    So what’s the next step?

  • #14 / Oct 31, 2010 3:30pm

    Greg Salt

    3988 posts

    Hi jtree,

    Have you used this host before for EE sites? What kind of server is it? What timezone is your server set to? Which timezone is your php.ini file set to use (the key should be key.timezone)?

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases