File Coverage

blib/lib/DateTime/TimeZone/UTC.pm
Criterion Covered Total %
statement 18 21 85.7
branch n/a
condition n/a
subroutine 9 12 75.0
pod 7 7 100.0
total 34 40 85.0


line stmt bran cond sub pod time code
1             package DateTime::TimeZone::UTC;
2              
3 20     20   159 use strict;
  20         41  
  20         712  
4 20     20   91 use warnings;
  20         46  
  20         962  
5 20     20   104 use namespace::autoclean;
  20         35  
  20         148  
6              
7             our $VERSION = '2.67';
8              
9 20     20   1742 use parent 'Class::Singleton', 'DateTime::TimeZone';
  20         36  
  20         121  
10              
11             sub new {
12 12     12 1 60 return shift->instance;
13             }
14              
15             ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
16             sub _new_instance {
17 11     11   148 my $class = shift;
18              
19 11         62 return bless { name => 'UTC' }, $class;
20             }
21             ## use critic
22              
23 0     0 1 0 sub is_dst_for_datetime {0}
24              
25 51     51 1 542 sub offset_for_datetime {0}
26 2478     2478 1 27247 sub offset_for_local_datetime {0}
27              
28 0     0 1 0 sub short_name_for_datetime {'UTC'}
29              
30 0     0 1 0 sub category {undef}
31              
32 4965     4965 1 153573 sub is_utc {1}
33              
34             1;
35              
36             # ABSTRACT: The UTC time zone
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             DateTime::TimeZone::UTC - The UTC time zone
47              
48             =head1 VERSION
49              
50             version 2.67
51              
52             =head1 SYNOPSIS
53              
54             my $utc_tz = DateTime::TimeZone::UTC->new;
55              
56             =head1 DESCRIPTION
57              
58             This class is used to provide the DateTime::TimeZone API needed by DateTime.pm
59             for the UTC time zone, which is not explicitly included in the Olson time zone
60             database.
61              
62             The offset for this object will always be zero.
63              
64             =head1 USAGE
65              
66             This class has the same methods as a real time zone object, but the
67             C<category()> method returns undef and C<is_utc()> returns true.
68              
69             =head1 SUPPORT
70              
71             Bugs may be submitted at L<https://github.com/houseabsolute/DateTime-TimeZone/issues>.
72              
73             =head1 SOURCE
74              
75             The source code repository for DateTime-TimeZone can be found at L<https://github.com/houseabsolute/DateTime-TimeZone>.
76              
77             =head1 AUTHOR
78              
79             Dave Rolsky <autarch@urth.org>
80              
81             =head1 COPYRIGHT AND LICENSE
82              
83             This software is copyright (c) 2026 by Dave Rolsky.
84              
85             This is free software; you can redistribute it and/or modify it under
86             the same terms as the Perl 5 programming language system itself.
87              
88             The full text of the license can be found in the
89             F<LICENSE> file included with this distribution.
90              
91             =cut