Jump to content

PHP translation of UNIX timestamp 1 hour off - Unable to find root cause


Recommended Posts

Hello,

 

I am hoping someone may be able to help me out with a strange issue that i cannot seem to resolve.

 

I have a server that is running CentOS 6.2 with Virtualmin as the control panel. It is running PHP v5.3.3.

 

I am haing an issue where PHP is apparently translating the UNIX timestamp as 1 hour earlier than the actual server time. (The server has the correct time and the date command does output the correct time and timezone.)

 

I am having issues with countdown timers and other items that rely on the date. (This is causing errors on the sites...) After confirming the server's time is correct, I added the below line to my footer page in a site on the server and when viewing the page source it gives me a timestamp of one hour earlier than the actual system time..

 

<!-- SERVER's UNIX TIMESTAMP: <?php echo time(); ?> -->

 

I only have two domains on this box so i then went in and edited the following files: (commented out all the date.timezone lines) to see if this was the issue..

 

/etc/php.ini /home/domain1/etc/php.ini /home/domain1/etc/php5/php.ini

 

/home/domain2/etc/php.ini /home/domain2/etc/php5/php.ini

 

Then restarted apache, and i am still getting the same thing... 1hour off... from the php output from above...

 

So, I am at a loss on what to do to correct this now. Any help here is really appreciated!

 

Thanks alot

Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.