From c93fb5b2cf7cc8cae3d56b739bfd6eac84d95544 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Fri, 13 Feb 2026 18:26:48 +0100 Subject: [PATCH] Use always internal parsing for iso date/times When using RT "unknown" date format, external perl modules are used and fails: * Time::ParseDate fail to parse iso format and produce wrong date/time, * DateTime::Format::Natural claims string isn't parseable. This is a problem when updating RT DateTime CF from REST where iso8601 is recommended. _CanonicalizeValueDateTime parse input as "unknown" and produces wrong dates. --- lib/RT/Date.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm index 6647333cfb..95d96f7fd5 100644 --- a/lib/RT/Date.pm +++ b/lib/RT/Date.pm @@ -199,7 +199,7 @@ sub Set { $RT::Logger->warning("Invalid date $args{'Value'}: $@") if $@ && !$u; return $self->Unix( $u > 0 ? $u : 0 ); } - elsif ( $format eq 'iso' && + elsif ( ( $format eq 'iso' || $format eq 'unknown' ) && ( $args{'Value'} =~ /^(\d{4})-(\d\d)-(\d\d)[ T](\d\d):(\d\d):(\d\d)Z?$/ || $args{'Value'} =~ /^(\d{4})(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)Z?$/)) { local $@;