Bug 20123: Allow multiple instances of Koha to have different timezones on the same...
authorKyle M Hall <kyle@bywatetsolutions.com>
Thu, 1 Feb 2018 18:21:54 +0000 (13:21 -0500)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Apr 2018 18:05:01 +0000 (15:05 -0300)
commit4cdf3e38afd608bcd0f8a1c7b6918d40ad84859f
treebf1a835d788d9954484c8bcd53659c11c3662912
parent33618eaec3eedf148a235d246e5ccc9ebc9ae7c3
Bug 20123: Allow multiple instances of Koha to have different timezones on the same server

Most of Koha depends on the local timezone of the server, except for Koha::Database which support an ENV override with the key TZ.

We should take this a step further. We should not only accept the TZ environment variable for all of Koha, we should really be able to set the timezone in the koha conf file as well so we don't have to pass that environment variable to things like cronjobs and one-off scripts.

Test Plan:
1) Apply this patch
2) Set a timzone in your koha_conf file, that is *not* your local time zone
   Available timzones are listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3) Restart apache/plack
4) Perform some actions, check the timestamps in the database and in the
   html output, note they are for the set timezone and not the local
   timezone.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Context.pm
Koha/Database.pm
t/timezones.t [new file with mode: 0644]