Is it OK to modify app/Mage.php to edit the date_default_timezone_set value?

I've modified my timezone in magento at System => General => Locale Options => Timezone, and set it to America/New_York, but it's still showing UTC time and every time based function is keying off of UTC time.

When I look at app/Mage.php it shows:

if (is_readable($localConfigFile)) {
    $localConfig = simplexml_load_file($localConfigFile);
    if (($date = $localConfig->global->install->date) && strtotime($date)) {
        self::$_isInstalled = true;

Thus, I assume I have to modify date_local_timezone_set from UTC to America/New_York? But is it OK to modify the app/Mage.php in this manner?

Thank you.

  • modifying mage is not at all reccommended. Jan 4 '18 at 4:41
  • @ShyamKrishnaSreekumar Ok. So how do I get this to change? My server time is Pacific Time (PST), my local time is Eastern Time (EST), and Magento's time is apparently UTC.
    – James
    Jan 4 '18 at 5:14

It is not recommended, but unfortunately it is required if you want to effectively synchronize Magento & your local timezone... as this had been a (really annoying) bug since day 1 & never fixed

More details here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.