Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to change the Mage::log() timestamp in magento? I would prefer it to match my timezone.

share|improve this question

migrated from stackoverflow.com Dec 2 '11 at 23:31

This question came from our site for professional and enthusiast programmers.

I'm sure it's possible. Have you looked at the source? – Colin Dec 2 '11 at 19:27
I know it all extends from the Zend_Log::log() method, which has a hard-coded date('c') for the timestamp placeholder in the format. but I'm not sure if there is a way to adjust this...I don't think so. – veilig Dec 2 '11 at 20:43
If you have access to the source code, you can modify anything you'd like, can't you? – Colin Dec 2 '11 at 20:44

I found this which might be some help.

Magento internally sets all cron dates to occur in GMT, it actually overrides the server php time zone settings so that all log events and all cron time schedules are triggered in the GMT timezone - you can see this in Mage.php on line 527. All php time functions called within Magento will be in GMT as a result (like the timestamp in the log call above).

Magento then adds back your timezone offset based on your locale settings when it shows you times in the admin panel. It does this so you can run multiple stores in different timezones based on your locale choice and ideally you would never know nor care about this - but it makes debugging cron events really confusing.

share|improve this answer

Since I am from India, in app/mage.php at around line number 767, I modified this to be:


Then it started displaying my local time as time stamp in log files. So you can add your own time zone...I'm sure it will work.

share|improve this answer
This is poor advice. You have no idea what other effects this will have on anything that expects the timezone to be UTC. Plus updating Magento will overwrite the change, one main reason for not changing core files. – Walf Nov 7 '14 at 1:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.