diff options
author | mkanat%bugzilla.org <> | 2006-09-29 10:55:05 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-09-29 10:55:05 +0200 |
commit | 65a9538ec79d1dcd1d903e38599d53f29676f39b (patch) | |
tree | f26ecadad7c591384398249fca19a53ce5d54c02 /Bugzilla/WebService | |
parent | e4a1df177e7804f9bf98edfba7fde3a74a0ecbae (diff) | |
download | bugzilla-65a9538ec79d1dcd1d903e38599d53f29676f39b.tar.gz bugzilla-65a9538ec79d1dcd1d903e38599d53f29676f39b.tar.xz |
Bug 351178: WebService needs to be able to provide the server's timezone
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wurblzap, a=myk
Diffstat (limited to 'Bugzilla/WebService')
-rwxr-xr-x | Bugzilla/WebService/Bugzilla.pm | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm index 0caf5fab2..dfab69845 100755 --- a/Bugzilla/WebService/Bugzilla.pm +++ b/Bugzilla/WebService/Bugzilla.pm @@ -13,6 +13,7 @@ # The Original Code is the Bugzilla Bug Tracking System. # # Contributor(s): Marc Schumann <wurblzap@gmail.com> +# Max Kanat-Alexander <mkanat@bugzilla.org> package Bugzilla::WebService::Bugzilla; @@ -20,8 +21,51 @@ use strict; use base qw(Bugzilla::WebService); use Bugzilla::Constants; -sub get_version { +use Time::Zone; + +sub version { return BUGZILLA_VERSION; } +sub timezone { + my $offset = tz_offset(); + $offset = (($offset / 60) / 60) * 100; + $offset = sprintf('%+05d', $offset); + return 'GMT' . $offset; +} + 1; + +__END__ + +=head1 NAME + +Bugzilla::WebService::Bugzilla - Global functions for the webservice interface. + +=head1 SYNOPSIS + + my $version = Bugzilla.version; + my $tz = Bugzilla.timezone; + +=head1 DESCRIPTION + +This provides functions that tell you about Bugzilla in general. + +=head1 METHODS + +See L<Bugzilla::WebService> for a description of what B<STABLE>, B<UNSTABLE>, +and B<EXPERIMENTAL> mean. + +=over + +=item C<version> + +Returns the current version of Bugzilla, as a string. + +=item C<timezone> + +Returns the timezone of the server Bugzilla is running on, in GMT(+/-)XXXX +format. This is important because all dates/times that the webservice +interface returns will be in this timezone. + +=back |