The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Time correct in server but php gives wrong time

Discussion in 'General Discussion' started by cpN00bie, Feb 7, 2015.

  1. cpN00bie

    cpN00bie Member

    Joined:
    Dec 31, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    :rolleyes:
    This is really strange.

    WHM>Sever Configuration> Server Time says:
    Sat Feb 7 20:37:58 CST 2015

    That is correct. But...

    Code:
    echo date("m-d-Y",$_SERVER['REQUEST_TIME']);
    
    Gives: 02-08-2015

    Why is PHP giving me February 8th ????

    Thanx
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Check to see if you use a different time zone in your /usr/local/lib/php.ini file:

    Code:
    grep date.timezone /usr/local/lib/php.ini
    If so, you can modify it, save the file, and restart Apache to enact the change.

    Thank you.
     
  3. cpN00bie

    cpN00bie Member

    Joined:
    Dec 31, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanx m8, that was the problem :)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page