diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-03-08 08:34:34 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-03-08 08:34:34 +0100 |
commit | 9947ffcb75bcb1f27b07cc9d849f69ed97996d7e (patch) | |
tree | 4e03417d278607863f64577a2af0676f2a134050 /Bugzilla/WebService | |
parent | f2660e7a442079cadd07a9824c430534e10bd52e (diff) | |
download | bugzilla-9947ffcb75bcb1f27b07cc9d849f69ed97996d7e.tar.gz bugzilla-9947ffcb75bcb1f27b07cc9d849f69ed97996d7e.tar.xz |
Bug 550618: Make the XML-RPC WebService return the right date format
r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r-- | Bugzilla/WebService/Server.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server.pm b/Bugzilla/WebService/Server.pm index 21f0f787c..71c790e8e 100644 --- a/Bugzilla/WebService/Server.pm +++ b/Bugzilla/WebService/Server.pm @@ -21,6 +21,8 @@ use strict; use Bugzilla::Error; use Bugzilla::Util qw(datetime_from); +use Scalar::Util qw(blessed); + sub handle_login { my ($self, $class, $method, $full_method) = @_; eval "require $class"; @@ -38,4 +40,19 @@ sub datetime_format_inbound { return $time } +sub datetime_format_outbound { + my ($self, $date) = @_; + + my $time = $date; + if (blessed($date)) { + # We expect this to mean we were sent a datetime object + $time->set_time_zone('UTC'); + } else { + # We always send our time in UTC, for consistency. + # passed in value is likely a string, create a datetime object + $time = datetime_from($date, 'UTC'); + } + return $time->iso8601(); +} + 1; |