From 9a9405da0b6b5baf8157206d34ba3895fb33b788 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 4 Mar 2010 14:28:32 -0500 Subject: Bug 545299, XML-RPC WebService should take and return dates and times in UTC. Code part, r+=mkanat --- Bugzilla/WebService/Server/XMLRPC.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Bugzilla/WebService/Server/XMLRPC.pm') diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index f06c81fc7..04e38c4a0 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -106,10 +106,12 @@ sub decode_value { # We convert dateTimes to a DB-friendly date format. if ($type eq 'dateTime.iso8601') { - # We leave off the $ from the end of this regex to allow for possible - # extensions to the XML-RPC date standard. - $value =~ /^(\d{4})(\d{2})(\d{2})T(\d{2}):(\d{2}):(\d{2})/; - $value = "$1-$2-$3 $4:$5:$6"; + if ($value !~ /T.*[\-+Z]/i) { + # The caller did not specify a timezone, so we assume UTC. + # pass 'Z' specifier to datetime_from to force it + $value = $value . 'Z'; + } + $value = $self->datetime_format_inbound($value); } return $value; -- cgit v1.2.3-24-g4f1b