| 1 |
package DateTime::TimeZone::UTC; |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use namespace::autoclean; |
| 6 |
|
| 7 |
our $VERSION = '2.70'; |
| 8 |
|
| 9 |
use parent 'Class::Singleton', 'DateTime::TimeZone'; |
| 10 |
|
| 11 |
sub new { |
| 12 |
return shift->instance; |
| 13 |
} |
| 14 |
|
| 15 |
## no critic (Subroutines::ProhibitUnusedPrivateSubroutines) |
| 16 |
sub _new_instance { |
| 17 |
my $class = shift; |
| 18 |
|
| 19 |
return bless { name => 'UTC' }, $class; |
| 20 |
} |
| 21 |
## use critic |
| 22 |
|
| 23 |
sub is_dst_for_datetime {0} |
| 24 |
|
| 25 |
sub offset_for_datetime {0} |
| 26 |
sub offset_for_local_datetime {0} |
| 27 |
|
| 28 |
sub short_name_for_datetime {'UTC'} |
| 29 |
|
| 30 |
sub category {undef} |
| 31 |
|
| 32 |
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.70 |
| 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 <[email protected]> |
| 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 |