How to change Magento timezone?Order time stamp off by 6 hours in the order Confirmation Email. It is CORRECT on the order itself in the Admin panelCronjob trouble after changing timezoneIs it OK to modify app/Mage.php to edit the date_default_timezone_set value in magento 1.9?Magento 1.9.2 not sending new order confirmation emailsMagento checking order updated_at using Magento date and timeFresh install, no plug ins, fatal error on category management pageHow to set Local Timezone when saving time into DB in MagentoOrder time stamp off by 6 hours in the order Confirmation Email. It is CORRECT on the order itself in the Admin panelMagento Timezone Wrongmagento orders timezone issueHow to edit “This Shipping method is currently unavailable” messageMagento 1.9.3.8 Saving Newsletter subscriptions and unsubscriptions timestampGetting error after adding config in Magento 1.9.3.6
CREATE opcode: what does it really do?
Italian words for tools
How does Loki do this?
Personal Teleportation as a Weapon
Is there a problem with hiding "forgot password" until it's needed?
Applicability of Single Responsibility Principle
How does it work when somebody invests in my business?
Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?
Balance Issues for a Custom Sorcerer Variant
How to check is there any negative term in a large list?
How to escape string to filename? It is in backup a file append date
What is paid subscription needed for in Mortal Kombat 11?
Tiptoe or tiphoof? Adjusting words to better fit fantasy races
What is the best translation for "slot" in the context of multiplayer video games?
Two monoidal structures and copowering
Why, precisely, is argon used in neutrino experiments?
How do I go from 300 unfinished/half written blog posts, to published posts?
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Overloading istream>> to read comma-separated input
What is the intuitive meaning of having a linear relationship between the logs of two variables?
Closest Prime Number
Class Action - which options I have?
How to write papers efficiently when English isn't my first language?
How did Arya survive the stabbing?
How to change Magento timezone?
Order time stamp off by 6 hours in the order Confirmation Email. It is CORRECT on the order itself in the Admin panelCronjob trouble after changing timezoneIs it OK to modify app/Mage.php to edit the date_default_timezone_set value in magento 1.9?Magento 1.9.2 not sending new order confirmation emailsMagento checking order updated_at using Magento date and timeFresh install, no plug ins, fatal error on category management pageHow to set Local Timezone when saving time into DB in MagentoOrder time stamp off by 6 hours in the order Confirmation Email. It is CORRECT on the order itself in the Admin panelMagento Timezone Wrongmagento orders timezone issueHow to edit “This Shipping method is currently unavailable” messageMagento 1.9.3.8 Saving Newsletter subscriptions and unsubscriptions timestampGetting error after adding config in Magento 1.9.3.6
I have used Magento 1.9 initially timezone was America/Los_Angeles in app/etc/config.xml file and set India/Calcutta timezone in
System -> Configuration -> General -> Locale Options ->Timezone
at that time Magento function Mage::getModel('core/date')->date('Y-m-d H:i:s') return correct date.
But order placed time was -5:30 to real time.
For set Asia/Calcutta timezone, I have changed app/etc/config.xml general->locale->timezone to Asia/Calcutta and in app/Mage.php I have changed UTC to Asia/Calcutta,
And it has changed the timezone in the backend, it means order placed time is correct as real-time but the function Mage::getModel('core/date')->date('Y-m-d H:i:s') return me +5:30 time to real time.
Is there any place where I missed to change?
Or Is there another method to change the timezone of the Magento store?
magento-1.9 timezone
add a comment |
I have used Magento 1.9 initially timezone was America/Los_Angeles in app/etc/config.xml file and set India/Calcutta timezone in
System -> Configuration -> General -> Locale Options ->Timezone
at that time Magento function Mage::getModel('core/date')->date('Y-m-d H:i:s') return correct date.
But order placed time was -5:30 to real time.
For set Asia/Calcutta timezone, I have changed app/etc/config.xml general->locale->timezone to Asia/Calcutta and in app/Mage.php I have changed UTC to Asia/Calcutta,
And it has changed the timezone in the backend, it means order placed time is correct as real-time but the function Mage::getModel('core/date')->date('Y-m-d H:i:s') return me +5:30 time to real time.
Is there any place where I missed to change?
Or Is there another method to change the timezone of the Magento store?
magento-1.9 timezone
add a comment |
I have used Magento 1.9 initially timezone was America/Los_Angeles in app/etc/config.xml file and set India/Calcutta timezone in
System -> Configuration -> General -> Locale Options ->Timezone
at that time Magento function Mage::getModel('core/date')->date('Y-m-d H:i:s') return correct date.
But order placed time was -5:30 to real time.
For set Asia/Calcutta timezone, I have changed app/etc/config.xml general->locale->timezone to Asia/Calcutta and in app/Mage.php I have changed UTC to Asia/Calcutta,
And it has changed the timezone in the backend, it means order placed time is correct as real-time but the function Mage::getModel('core/date')->date('Y-m-d H:i:s') return me +5:30 time to real time.
Is there any place where I missed to change?
Or Is there another method to change the timezone of the Magento store?
magento-1.9 timezone
I have used Magento 1.9 initially timezone was America/Los_Angeles in app/etc/config.xml file and set India/Calcutta timezone in
System -> Configuration -> General -> Locale Options ->Timezone
at that time Magento function Mage::getModel('core/date')->date('Y-m-d H:i:s') return correct date.
But order placed time was -5:30 to real time.
For set Asia/Calcutta timezone, I have changed app/etc/config.xml general->locale->timezone to Asia/Calcutta and in app/Mage.php I have changed UTC to Asia/Calcutta,
And it has changed the timezone in the backend, it means order placed time is correct as real-time but the function Mage::getModel('core/date')->date('Y-m-d H:i:s') return me +5:30 time to real time.
Is there any place where I missed to change?
Or Is there another method to change the timezone of the Magento store?
magento-1.9 timezone
magento-1.9 timezone
edited yesterday
magefms
2,0722426
2,0722426
asked Mar 10 '16 at 6:20
Vinaya MaheshwariVinaya Maheshwari
1,18711847
1,18711847
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
You can set timezone from Admin panel ,
Go to :
System => Configuration => General => Locale Options =>Timezone

AND
Change the default timezon in file app/Mage.php
date_default_timezone_set('UTC');
Replace above line with following
date_default_timezone_set('Asia/Calcutta');
AND
Copy file app/code/core/Mage/Core/Model/Locale.php to app/code/local/Mage/Core/Model/Locale.php then find line 38
const DEFAULT_TIMEZONE = 'UTC';
Replace above line with following
const DEFAULT_TIMEZONE = 'Asia/Calcutta';
Note: If still it will not work. Dig in to following function in app/code/local/Mage/Core/Model/Locale.php.
public function storeDate($store=null, $date=null, $includeTime=false, $format = null)
$timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE);
$date = new Zend_Date($date, $format, $this->getLocale());
$date->setTimezone($timezone);
if (!$includeTime)
$date->setHour(0)
->setMinute(0)
->setSecond(0);
return $date;
Hope this helps
I have already setIndia Standard time (Asia/Calcutta)in Timezone.
– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
add a comment |
you have to set your timezone manually
first go to
app/etc/config.xml add your time zone here
<general>
<locale>
<code>en_US</code>
<timezone>Asia/Calcutta</timezone>
</locale>
</general>
second go to app/Mage.php
on line 768
change this line too
date_default_timezone_set('UTC');
to your timezone
date_default_timezone_set('Asia/Calcutta');
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem isMage::getModel('core/date')->date('Y-m-d H:i:s')function return me incorrect time +5:30 to real time. Is there any place where I missed to change?
– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? deletevar/cachefolder because for after these it good to go
– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
|
show 4 more comments
Your locale settings are defined in the configuration under System => Configuration => General => Locale Options =>Timezone, and can be set per website scope.
You can quickly get/change in your core_config_data table (SELECT * FROM core_config_data WHERE path = 'general/locale/timezone';).
You might use Mage::getModel('core/date') for getting current time and date.
Getting formatted date based on locale settings:
echo Mage::getModel('core/date')->date('d/m/Y H:i:s');
# return 22/10/2017 23:30:21
echo Mage::getModel('core/date')->timestamp();
# return current timestamp
echo date('d/m/Y H:i:s', Mage::getSingleton('core/date')->gmtTimestamp());
# returo current date in GMT timezone, doesn't matter your locale settings

See app/code/core/Mage/Core/Model/Date.php for a complete list of methods available.
My suggestion is: try to convert everything to GMT using this model's GMT methods, and stop worrying about php.ini, magento XML, and so on.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f105546%2fhow-to-change-magento-timezone%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can set timezone from Admin panel ,
Go to :
System => Configuration => General => Locale Options =>Timezone

AND
Change the default timezon in file app/Mage.php
date_default_timezone_set('UTC');
Replace above line with following
date_default_timezone_set('Asia/Calcutta');
AND
Copy file app/code/core/Mage/Core/Model/Locale.php to app/code/local/Mage/Core/Model/Locale.php then find line 38
const DEFAULT_TIMEZONE = 'UTC';
Replace above line with following
const DEFAULT_TIMEZONE = 'Asia/Calcutta';
Note: If still it will not work. Dig in to following function in app/code/local/Mage/Core/Model/Locale.php.
public function storeDate($store=null, $date=null, $includeTime=false, $format = null)
$timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE);
$date = new Zend_Date($date, $format, $this->getLocale());
$date->setTimezone($timezone);
if (!$includeTime)
$date->setHour(0)
->setMinute(0)
->setSecond(0);
return $date;
Hope this helps
I have already setIndia Standard time (Asia/Calcutta)in Timezone.
– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
add a comment |
You can set timezone from Admin panel ,
Go to :
System => Configuration => General => Locale Options =>Timezone

AND
Change the default timezon in file app/Mage.php
date_default_timezone_set('UTC');
Replace above line with following
date_default_timezone_set('Asia/Calcutta');
AND
Copy file app/code/core/Mage/Core/Model/Locale.php to app/code/local/Mage/Core/Model/Locale.php then find line 38
const DEFAULT_TIMEZONE = 'UTC';
Replace above line with following
const DEFAULT_TIMEZONE = 'Asia/Calcutta';
Note: If still it will not work. Dig in to following function in app/code/local/Mage/Core/Model/Locale.php.
public function storeDate($store=null, $date=null, $includeTime=false, $format = null)
$timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE);
$date = new Zend_Date($date, $format, $this->getLocale());
$date->setTimezone($timezone);
if (!$includeTime)
$date->setHour(0)
->setMinute(0)
->setSecond(0);
return $date;
Hope this helps
I have already setIndia Standard time (Asia/Calcutta)in Timezone.
– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
add a comment |
You can set timezone from Admin panel ,
Go to :
System => Configuration => General => Locale Options =>Timezone

AND
Change the default timezon in file app/Mage.php
date_default_timezone_set('UTC');
Replace above line with following
date_default_timezone_set('Asia/Calcutta');
AND
Copy file app/code/core/Mage/Core/Model/Locale.php to app/code/local/Mage/Core/Model/Locale.php then find line 38
const DEFAULT_TIMEZONE = 'UTC';
Replace above line with following
const DEFAULT_TIMEZONE = 'Asia/Calcutta';
Note: If still it will not work. Dig in to following function in app/code/local/Mage/Core/Model/Locale.php.
public function storeDate($store=null, $date=null, $includeTime=false, $format = null)
$timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE);
$date = new Zend_Date($date, $format, $this->getLocale());
$date->setTimezone($timezone);
if (!$includeTime)
$date->setHour(0)
->setMinute(0)
->setSecond(0);
return $date;
Hope this helps
You can set timezone from Admin panel ,
Go to :
System => Configuration => General => Locale Options =>Timezone

AND
Change the default timezon in file app/Mage.php
date_default_timezone_set('UTC');
Replace above line with following
date_default_timezone_set('Asia/Calcutta');
AND
Copy file app/code/core/Mage/Core/Model/Locale.php to app/code/local/Mage/Core/Model/Locale.php then find line 38
const DEFAULT_TIMEZONE = 'UTC';
Replace above line with following
const DEFAULT_TIMEZONE = 'Asia/Calcutta';
Note: If still it will not work. Dig in to following function in app/code/local/Mage/Core/Model/Locale.php.
public function storeDate($store=null, $date=null, $includeTime=false, $format = null)
$timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE);
$date = new Zend_Date($date, $format, $this->getLocale());
$date->setTimezone($timezone);
if (!$includeTime)
$date->setHour(0)
->setMinute(0)
->setSecond(0);
return $date;
Hope this helps
edited Mar 10 '16 at 7:46
answered Mar 10 '16 at 6:24
Rohit KundaleRohit Kundale
2,89911327
2,89911327
I have already setIndia Standard time (Asia/Calcutta)in Timezone.
– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
add a comment |
I have already setIndia Standard time (Asia/Calcutta)in Timezone.
– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
I have already set
India Standard time (Asia/Calcutta) in Timezone.– Vinaya Maheshwari
Mar 10 '16 at 6:31
I have already set
India Standard time (Asia/Calcutta) in Timezone.– Vinaya Maheshwari
Mar 10 '16 at 6:31
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
@VinayaMaheshwari Check updated answer
– Rohit Kundale
Mar 10 '16 at 6:38
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
Hello @Rohit, this is not working for me.
– Vinaya Maheshwari
Mar 10 '16 at 6:44
add a comment |
you have to set your timezone manually
first go to
app/etc/config.xml add your time zone here
<general>
<locale>
<code>en_US</code>
<timezone>Asia/Calcutta</timezone>
</locale>
</general>
second go to app/Mage.php
on line 768
change this line too
date_default_timezone_set('UTC');
to your timezone
date_default_timezone_set('Asia/Calcutta');
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem isMage::getModel('core/date')->date('Y-m-d H:i:s')function return me incorrect time +5:30 to real time. Is there any place where I missed to change?
– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? deletevar/cachefolder because for after these it good to go
– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
|
show 4 more comments
you have to set your timezone manually
first go to
app/etc/config.xml add your time zone here
<general>
<locale>
<code>en_US</code>
<timezone>Asia/Calcutta</timezone>
</locale>
</general>
second go to app/Mage.php
on line 768
change this line too
date_default_timezone_set('UTC');
to your timezone
date_default_timezone_set('Asia/Calcutta');
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem isMage::getModel('core/date')->date('Y-m-d H:i:s')function return me incorrect time +5:30 to real time. Is there any place where I missed to change?
– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? deletevar/cachefolder because for after these it good to go
– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
|
show 4 more comments
you have to set your timezone manually
first go to
app/etc/config.xml add your time zone here
<general>
<locale>
<code>en_US</code>
<timezone>Asia/Calcutta</timezone>
</locale>
</general>
second go to app/Mage.php
on line 768
change this line too
date_default_timezone_set('UTC');
to your timezone
date_default_timezone_set('Asia/Calcutta');
you have to set your timezone manually
first go to
app/etc/config.xml add your time zone here
<general>
<locale>
<code>en_US</code>
<timezone>Asia/Calcutta</timezone>
</locale>
</general>
second go to app/Mage.php
on line 768
change this line too
date_default_timezone_set('UTC');
to your timezone
date_default_timezone_set('Asia/Calcutta');
answered Mar 10 '16 at 6:29
Qaisar SattiQaisar Satti
27k1256109
27k1256109
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem isMage::getModel('core/date')->date('Y-m-d H:i:s')function return me incorrect time +5:30 to real time. Is there any place where I missed to change?
– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? deletevar/cachefolder because for after these it good to go
– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
|
show 4 more comments
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem isMage::getModel('core/date')->date('Y-m-d H:i:s')function return me incorrect time +5:30 to real time. Is there any place where I missed to change?
– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? deletevar/cachefolder because for after these it good to go
– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem is
Mage::getModel('core/date')->date('Y-m-d H:i:s') function return me incorrect time +5:30 to real time. Is there any place where I missed to change?– Vinaya Maheshwari
Mar 10 '16 at 6:34
Hello @Qaisar Satti, please read my question, both changes I have already made but the problem is
Mage::getModel('core/date')->date('Y-m-d H:i:s') function return me incorrect time +5:30 to real time. Is there any place where I missed to change?– Vinaya Maheshwari
Mar 10 '16 at 6:34
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
did you check with new order time is correct?
– Qaisar Satti
Mar 10 '16 at 6:35
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
Yes I have said in my question that order place time is correct.
– Vinaya Maheshwari
Mar 10 '16 at 6:37
did you refresh the cache? delete
var/cache folder because for after these it good to go– Qaisar Satti
Mar 10 '16 at 6:39
did you refresh the cache? delete
var/cache folder because for after these it good to go– Qaisar Satti
Mar 10 '16 at 6:39
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
Yes I refresh cache from backend and also remove from var/cache folder.
– Vinaya Maheshwari
Mar 10 '16 at 6:46
|
show 4 more comments
Your locale settings are defined in the configuration under System => Configuration => General => Locale Options =>Timezone, and can be set per website scope.
You can quickly get/change in your core_config_data table (SELECT * FROM core_config_data WHERE path = 'general/locale/timezone';).
You might use Mage::getModel('core/date') for getting current time and date.
Getting formatted date based on locale settings:
echo Mage::getModel('core/date')->date('d/m/Y H:i:s');
# return 22/10/2017 23:30:21
echo Mage::getModel('core/date')->timestamp();
# return current timestamp
echo date('d/m/Y H:i:s', Mage::getSingleton('core/date')->gmtTimestamp());
# returo current date in GMT timezone, doesn't matter your locale settings

See app/code/core/Mage/Core/Model/Date.php for a complete list of methods available.
My suggestion is: try to convert everything to GMT using this model's GMT methods, and stop worrying about php.ini, magento XML, and so on.
add a comment |
Your locale settings are defined in the configuration under System => Configuration => General => Locale Options =>Timezone, and can be set per website scope.
You can quickly get/change in your core_config_data table (SELECT * FROM core_config_data WHERE path = 'general/locale/timezone';).
You might use Mage::getModel('core/date') for getting current time and date.
Getting formatted date based on locale settings:
echo Mage::getModel('core/date')->date('d/m/Y H:i:s');
# return 22/10/2017 23:30:21
echo Mage::getModel('core/date')->timestamp();
# return current timestamp
echo date('d/m/Y H:i:s', Mage::getSingleton('core/date')->gmtTimestamp());
# returo current date in GMT timezone, doesn't matter your locale settings

See app/code/core/Mage/Core/Model/Date.php for a complete list of methods available.
My suggestion is: try to convert everything to GMT using this model's GMT methods, and stop worrying about php.ini, magento XML, and so on.
add a comment |
Your locale settings are defined in the configuration under System => Configuration => General => Locale Options =>Timezone, and can be set per website scope.
You can quickly get/change in your core_config_data table (SELECT * FROM core_config_data WHERE path = 'general/locale/timezone';).
You might use Mage::getModel('core/date') for getting current time and date.
Getting formatted date based on locale settings:
echo Mage::getModel('core/date')->date('d/m/Y H:i:s');
# return 22/10/2017 23:30:21
echo Mage::getModel('core/date')->timestamp();
# return current timestamp
echo date('d/m/Y H:i:s', Mage::getSingleton('core/date')->gmtTimestamp());
# returo current date in GMT timezone, doesn't matter your locale settings

See app/code/core/Mage/Core/Model/Date.php for a complete list of methods available.
My suggestion is: try to convert everything to GMT using this model's GMT methods, and stop worrying about php.ini, magento XML, and so on.
Your locale settings are defined in the configuration under System => Configuration => General => Locale Options =>Timezone, and can be set per website scope.
You can quickly get/change in your core_config_data table (SELECT * FROM core_config_data WHERE path = 'general/locale/timezone';).
You might use Mage::getModel('core/date') for getting current time and date.
Getting formatted date based on locale settings:
echo Mage::getModel('core/date')->date('d/m/Y H:i:s');
# return 22/10/2017 23:30:21
echo Mage::getModel('core/date')->timestamp();
# return current timestamp
echo date('d/m/Y H:i:s', Mage::getSingleton('core/date')->gmtTimestamp());
# returo current date in GMT timezone, doesn't matter your locale settings

See app/code/core/Mage/Core/Model/Date.php for a complete list of methods available.
My suggestion is: try to convert everything to GMT using this model's GMT methods, and stop worrying about php.ini, magento XML, and so on.
edited Oct 27 '17 at 3:05
answered Oct 27 '17 at 0:34
Ricardo MartinsRicardo Martins
648520
648520
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f105546%2fhow-to-change-magento-timezone%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown