0

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)) {
    libxml_disable_entity_loader(false);
    $localConfig = simplexml_load_file($localConfigFile);
    date_default_timezone_set('UTC');
    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. – Shyam Krishna Sreekumar 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
0

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

https://magento.stackexchange.com/a/105547/3566

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.