PHP Date function on server not returning correct time

Avatar
  • Answered
When using the php date() function the time is off by as much as forty minutes and as little as seven minutes. Selects into MySQL using now() reflect the correct time. How can this be corrected?
Avatar
johnpaulb-imhs1
Hello, Thank you for your question. We are happy to help, but will need some additional information. Are you using any offsets, or just the basic function. For example: date('Y-m-d H:i:s') Is the date ahead, or behind the actual time? Have you set the Timezone for PHP in the php.ini file? Newer versions of PHP require this step. Are you using caching on your server of any kind? Can you provide a link to the script, so we can test and replicate the problem? If you have any further questions, feel free to post them below. Thank you, John-Paul