Jump to content

Recommended Posts

I have read many forum posts on the use of date(), time(), and $_SERVER['REQUEST_TIME']. Here is my issue. My server is set for Mountain Standard Time (MST). I can see this in the server confiq. in php.ini the timezone is set to AMERICA/Phoenix. However when I run a script with just date() the time returned is clearly Eastern time. My script is stripped down to only return that function. I keep testing different inputs, I have tried to only call the $_SERVER['REQUEST_TIME'] and I keep getting Eastern (my timezone). What am I missing?

 

What I am trying to do: I have a script that should only display a dialogue box/input box at a certain time based on the server time, and the end of an offer time stored on my db. So I call the server time to compare to the end time on the db. The script works fine but actual time returned by date() messes it up by a couple hours.  Thanks in advance for advice.

Problem Solved.

 

I had this in my config file. I set it a long time ago and had forgotten about it. The answer is typically so simple, not sinister. Thanks for jogging my memory!

 

date_default_timezone_set('US/Eastern');

 

I removed it and bam! everything is working.

 

RG

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.