How can I use the Europe/Kyiv timezone in DDEV?

60 Views Asked by At

I work with Drupal ^10 on ddev. Previously about year or so I faced issue, after some update, keeps throwing error. Notice: date_default_timezone_set(): Timezone ID 'Europe/Kyiv' is invalid in Drupal\system\TimeZoneResolver->setDefaultTimeZone() (line 54 of core/modules/system/src/TimeZoneResolver.php).

When i tried ddev config --timezone=Europe/Kyiv I got next error Warning: date_default_timezone_get(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in Drupal\Core\Datetime\DateFormatter->format() (line 105 of core/lib/Drupal/Core/Datetime/DateFormatter.php). Before that update everything was fine, and no errors with timezone. So if I understand correctly, there was some update with tzdata and timezone was changed to more correct version instead of Europe/Kiev => Europe/Kyiv, that was included in some ubuntu version, but ddev building images like before that update. Maybe someone configured ddev to fix such problem.

1

There are 1 best solutions below

6
rfay On BEST ANSWER

The problem here is that the Debian tzdata package has recently changed to use Europe/Kyiv instead of Europe/Kiev.

You can:

  1. Use Europe/Kiev for now or
  2. Add the tzdata package to get it updated with
ddev config --webimage-extra-packages=tzdata --dbimage-extra-packages=tzdata
ddev config --timezone=Europe/Kyiv
ddev restart

In the v1.23.0 release of DDEV it will be Europe/Kyiv by default (since it will pick up the latest tzdata).