View | Details | Raw Unified | Return to bug 20123
Collapse All | Expand All

(-)a/C4/Context.pm (-1 / +17 lines)
Lines 969-974 sub get_versions { Link Here
969
    return %versions;
969
    return %versions;
970
}
970
}
971
971
972
=head2 timezone
973
974
  my $C4::Context->timzone
975
976
  Returns a timezone code for the instance of Koha
977
978
=cut
979
980
sub timezone {
981
    my $self = shift;
982
983
    my $timezone = C4::Context->config('timezone') || $ENV{TZ} || 'local';
984
985
    return $timezone;
986
}
972
987
973
=head2 tz
988
=head2 tz
974
989
Lines 981-987 sub get_versions { Link Here
981
sub tz {
996
sub tz {
982
    my $self = shift;
997
    my $self = shift;
983
    if (!defined $context->{tz}) {
998
    if (!defined $context->{tz}) {
984
        $context->{tz} = DateTime::TimeZone->new(name => 'local');
999
        my $timezone = $self->timezone;
1000
        $context->{tz} = DateTime::TimeZone->new(name => $timezone);
985
    }
1001
    }
986
    return $context->{tz};
1002
    return $context->{tz};
987
}
1003
}
(-)a/Koha/Database.pm (-2 / +1 lines)
Lines 70-76 sub _new_schema { Link Here
70
70
71
71
72
    my ( %encoding_attr, $encoding_query, $tz_query, $sql_mode_query );
72
    my ( %encoding_attr, $encoding_query, $tz_query, $sql_mode_query );
73
    my $tz = $ENV{TZ};
73
    my $tz = C4::Context->timezone;
74
    if ( $db_driver eq 'mysql' ) {
74
    if ( $db_driver eq 'mysql' ) {
75
        %encoding_attr = ( mysql_enable_utf8 => 1 );
75
        %encoding_attr = ( mysql_enable_utf8 => 1 );
76
        $encoding_query = "set NAMES 'utf8mb4'";
76
        $encoding_query = "set NAMES 'utf8mb4'";
77
- 

Return to bug 20123