1DateTime::TimeZone::OffUsseetrOnCloyn(t3r)ibuted Perl DoDcautmeeTnitmaet:i:oTnimeZone::OffsetOnly(3)
2
3
4
6 DateTime::TimeZone::OffsetOnly - A DateTime::TimeZone object that just
7 contains an offset
8
10 version 2.47
11
13 my $offset_tz = DateTime::TimeZone->new( name => '-0300' );
14
16 This class is used to provide the DateTime::TimeZone API needed by
17 DateTime.pm, but with a fixed offset. An object in this class always
18 returns the same offset as was given in its constructor, regardless of
19 the date.
20
22 This class has the same methods as a real time zone object, but the
23 "category()" method returns undef.
24
25 DateTime::TimeZone::OffsetOnly->new ( offset => $offset )
26 The value given to the offset parameter must be a string such as
27 "+0300". Strings will be converted into numbers by the
28 "DateTime::TimeZone::offset_as_seconds()" function.
29
30 $tz->offset_for_datetime( $datetime )
31 No matter what date is given, the offset provided to the constructor is
32 always used.
33
34 $tz->name()
35 $tz->short_name_for_datetime()
36 Both of these methods return the offset in string form.
37
39 Bugs may be submitted at
40 <https://github.com/houseabsolute/DateTime-TimeZone/issues>.
41
42 I am also usually active on IRC as 'autarch' on "irc://irc.perl.org".
43
45 The source code repository for DateTime-TimeZone can be found at
46 <https://github.com/houseabsolute/DateTime-TimeZone>.
47
49 Dave Rolsky <autarch@urth.org>
50
52 This software is copyright (c) 2021 by Dave Rolsky.
53
54 This is free software; you can redistribute it and/or modify it under
55 the same terms as the Perl 5 programming language system itself.
56
57 The full text of the license can be found in the LICENSE file included
58 with this distribution.
59
60
61
62perl v5.32.0 2021-01-26 DateTime::TimeZone::OffsetOnly(3)