简体   繁体   中英

How to fix opencart default timezone

my opencart version is 2.3.02 all my activities' time-stamp is showing 1 hour advanced.

hosting server timezone 'America/Chicago' I'm trying to set it to 'Europe/London'

I've tried php.ini, .htaccess and changing scripts here & there but found no solution. Could somebody please tell me how to fix this issue?

The following instruction in the Opencart forum solved the issue for me: https://forum.opencart.com/viewtopic.php?f=20&t=31844&p=260898&hilit=timezone

I have updated system/startup.php

// if (!ini_get('date.timezone')) {
//  date_default_timezone_set('UTC');
// }
date_default_timezone_set('Europe/Amsterdam');

You can set timezone with querying;

SET time_zone = 'Europe/London';
SET time_zone = "+00:00";
SET @@session.time_zone = "+00:00";
date_default_timezone_set("Europe/London");
echo date("Y-m-d H:i:s"); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM