How to make debug.log timestamps local time?

I look at the debug.log file a lot while developing, and having all the timestamps in UTC drives me crazy! How can I get them to display in local time? I have my php.ini 'date_timezone' value set to 'America/Los_Angeles' already.

Topic timestamp debug Wordpress

Category Web


You can retrieve the debug.log, convert the dates yourself, and display the results in your admin area.

I did this for a plugin I made, but have changed the code slightly to display the debug.log in a custom Dashboard widget so someone else can use it.

It will also highlight lines that contain issues from the functions.php file, as well as an additional keyword through a query string search. The code can be found here:

https://gist.github.com/mrgandy/8b6c198d8abf30d3f4e9def7300cc60c


What is the time zone setup in your admin -> settings -> general page? WordPress overrides & kind of disregards php's timezone & uses this own settings , if haven't set this - default is UTC+0

Update: according to https://core.trac.wordpress.org/ticket/39595 - wordpress has forced this to be UTC

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.