From ca292e6346ed7888efa19ef9763570668dfce34b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 9 Aug 2023 01:44:53 +1200 Subject: [PATCH] Bug 34489: Testing Content-Type: text/plain; charset=utf-8 --- Koha/DateUtils.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 86c8314b4f..11751f4220 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -64,7 +64,12 @@ sub dt_from_string { my $server_tz = C4::Context->tz; $tz = C4::Context->tz unless $tz; - return DateTime->now( time_zone => $tz ) unless $date_string; + unless( $date_string ) { + # my $dt = DateTime->now( time_zone => $tz ); + my $dt = DateTime->now( time_zone => $server_tz ); + warn "L069 ". $dt->time_zone_short_name; + return $dt; + } $date_format = C4::Context->preference('dateformat') unless $date_format; @@ -245,6 +250,8 @@ sub dt_from_string { # Convert to configured timezone (unless we started with a dateonly string or had to drop to floating time) $dt->set_time_zone($server_tz) unless ( $date_only || $floating ); + # $dt->set_time_zone($server_tz) unless $floating; +warn "L249 ". $server_tz->name.' '.$dt->time_zone_short_name; return $dt; } -- 2.30.2