troubleshooting Question

php error_log date and time format settings

Avatar of Mark Brady
Mark BradyFlag for United States of America asked on
PHPScripting Languages
5 Comments1 Solution3628 ViewsLast Modified:
I know I should know this but it's driving me nuts. How do you set the date and time format in php error_log(). I have set the default_time_zone setting and made sure the system date and time zones are correct. Here is what the error log puts out

[30-Jun-2012 01:17:09 UTC] test
[30-Jun-2012 01:17:10 UTC] test
[30-Jun-2012 01:32:27 UTC] test
[30-Jun-2012 01:32:32 UTC] test..... etc

I want it to put out

[2012-06-30 22:17:09] test
[2012-06-30 22:17:09] test
[2012-06-30 22:17:09] test
[2012-06-30 22:17:09] test.... etc

I would prefer it doesn't use UTC as I have set my timezone to 'America/New_York'

We are in Florida so it should be reporting as EST but the most important part is to have the error_log file record the system time and in the correct format ie: 'Y-m-d H:i:s'

Thanks for the help. I should know this stuff but for years I have been using an error log at work that records the date properly. I'm just not at work now :)
ASKER CERTIFIED SOLUTION
Mark Brady
Principal Data Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros