1package DateTime::TimeZone::Floating;
2
3use strict;
4
5use vars qw ($VERSION @ISA);
6$VERSION = 0.01;
7
8use DateTime::TimeZone;
9use base 'DateTime::TimeZone::OffsetOnly';
10
11sub new
12{
13    my $class = shift;
14
15    return bless { name => 'floating',
16                   offset => 0 }, $class;
17}
18
19sub is_floating { 1 }
20
21sub STORABLE_thaw
22{
23    my $self = shift;
24    my $cloning = shift;
25    my $serialized = shift;
26
27    my $class = ref $self || $self;
28
29    my $obj;
30    if ( $class->isa(__PACKAGE__) )
31    {
32        $obj = __PACKAGE__->new();
33    }
34    else
35    {
36        $obj = $class->new();
37    }
38
39    %$self = %$obj;
40
41    return $self;
42}
43
44
45__END__
46
47=head1 NAME
48
49DateTime::TimeZone::Floating - A time zone that is always local
50
51=head1 SYNOPSIS
52
53  my $floating_tz = DateTime::TimeZone::Floating->new;
54
55=head1 DESCRIPTION
56
57This class is used to provide the DateTime::TimeZone API needed by
58DateTime.pm, but for floating times, as defined by the RFC 2445 spec.
59A floating time has no time zone, and has an effective offset of zero.
60
61=head1 USAGE
62
63This class has the same methods as a real time zone object, but the
64C<short_name_for_datetime()>, and C<category()> methods both return
65undef.
66
67=head1 AUTHOR
68
69Dave Rolsky, <autarch@urth.org>
70
71=head1 COPYRIGHT & LICENSE
72
73Copyright (c) 2003-2008 David Rolsky.  All rights reserved.  This
74program is free software; you can redistribute it and/or modify it
75under the same terms as Perl itself.
76
77The full text of the license can be found in the LICENSE file included
78with this module.
79
80=cut
81