0

My current timezone is "Europe/Berlin". I want to change it to 'Asia/Calcutta' how to change timezone in shopware 6? Which file do I want to change?

Abin John
  • 103
  • 10

4 Answers4

0

This should be part of your php environment, just make sure, that PHP uses the timezone you need.

mnaczenski
  • 1,508
  • 7
  • 12
  • Default timezone, $_COOKIE['timezone'], $_SERVER['HTTP_COOKIE'], HTTP_COOKIE in PHPinfo is "Asia/Calcutta". But the system shows "Europe/Berlin". – Abin John Jan 06 '20 at 06:46
  • Shopware saves every timestamp in utc - only the frontend/administration calculates the timestamp based on the clients timezone. So if your client uses Europe/Berlin, every time will be Europe/Berlin. When you are located in Asia, it should be Asia/Calcutta. – mnaczenski Jan 06 '20 at 07:58
  • Shopware 6 is running on my local machine via docker. In which file I can change the timezone? – Abin John Jan 07 '20 at 04:42
0

If you have a c-panel, pleskpanel or some alternative, you can change it through it or from php settings $_COOKIE['timezone'], $_SERVER['HTTP_COOKIE'], HTTP_COOKIE

The timezone is taken as the default timezone of the server.

Please see this link Setting the Timezone for PHP in the php.ini file

David
  • 553
  • 6
  • 21
0

I believed that you can change the timezone in public/index.php

$request = Request::createFromGlobals();
$kernel = new HttpKernel($appEnv, $debug, $classLoader);
date_default_timezone_set( 'Asia/Calcutta' );
$result = $kernel->handle($request);
Dharman
  • 30,962
  • 25
  • 85
  • 135
Stone Vo
  • 119
  • 5
0

For docker you edit the docker-compose.yml file like so:

environment:
  - TZ=Asia/Calcutta

In a Docker file:

ENV TZ="Asia/Calcutta"

or if you start docker from command line:

docker run -it -e TZ="Asia/Calcutta"
augsteyer
  • 1,039
  • 10
  • 25