@@ -, +, @@ --- Koha/DateUtils.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/Koha/DateUtils.pm +++ a/Koha/DateUtils.pm @@ -143,7 +143,7 @@ sub dt_from_string { } # Add the faculative time part [hh:mm[:ss]] - my $time_re .= qr| + my $time_re .= qr{ ( [Tt]? \s* @@ -158,8 +158,11 @@ sub dt_from_string { \s (?\w{2}) )? + ( + (?[Zz]$)|((?[\+|\-])(?[01][0-9]|2[0-3]):(?[0-5][0-9])) + )? )? - |xms; + }xms; $regex .= $time_re unless ( $date_format eq 'rfc3339' ); $fallback_re .= $time_re; @@ -175,6 +178,9 @@ sub dt_from_string { second => $+{second}, ); $ampm = $+{ampm}; + if ( $+{utc} ) { + $tz = DateTime::TimeZone->new( name => 'UTC' ); + } if ( $+{offset} ) { # If offset given, set inbound timezone using it. $tz = DateTime::TimeZone->new( name => $+{offset} . $+{hours} . $+{minutes} ); --