1MooseX::Types::DateTimeU:s:eBrutCMoanitnrtiabiunteeddM(o3Po)esrelX:D:oTcyupmeesn:t:aDtaitoenTime::ButMaintained(3)
2
3
4
6 MooseX::Types::DateTime::ButMaintained - DateTime related constraints
7 and coercions for Moose
8
10 Export Example:
11
12 use MooseX::Types::DateTime::ButMaintained qw(TimeZone);
13 has time_zone => (
14 isa => TimeZone
15 , is => "rw"
16 , coerce => 1
17 );
18 Class->new( time_zone => "Africa/Timbuktu" );
19 Class->new( time_zone => "CEST" );
20
21 Namespaced Example:
22
23 use MooseX::Types::DateTime::ButMaintained;
24 has time_zone => (
25 isa => 'DateTime::TimeZone'
26 , is => "rw"
27 , coerce => 1
28 );
29 Class->new( time_zone => "Africa/Timbuktu" );
30
32 DateTime
33 A class type for DateTime.
34
35 from "Num"
36 Uses "from_epoch" in DateTime. Floating values will be used for
37 subsecond percision, see DateTime for details.
38
39 from "HashRef"
40 Calls "new" in DateTime with the hash entries as arguments.
41
42 Duration
43 A class type for DateTime::Duration
44
45 from "Num"
46 Uses "new" in DateTime::Duration and passes the number as the
47 "seconds" argument.
48
49 Note that due to leap seconds, DST changes etc this may not do
50 what you expect. For instance passing in 86400 is not always
51 equivalent to one day, although there are that many seconds in
52 a day. See "How Date Math is Done" in DateTime for more
53 details.
54
55 from "HashRef"
56 Calls "new" in DateTime::Duration with the hash entries as
57 arguments.
58
59 DateTime::Locale
60 A class type for DateTime::Locale::root with the name
61 DateTime::Locale.
62
63 from "Str"
64 The string is treated as a language tag (e.g. "en" or "he_IL")
65 and given to "load" in DateTime::Locale.
66
67 from Locale::Maktext
68 The "Locale::Maketext/language_tag" attribute will be used with
69 "load" in DateTime::Locale.
70
71 DateTime::TimeZone
72 A class type for DateTime::TimeZone, this now as of 0.05 coerces
73 from non-globally ambigious Olson abbreviations, using
74 Olson::Abbreviations. This won't work for abbreviations like "EST"
75 which are only unambigious if you know the locale. It will coerce
76 from abbreviations like "CEST" though.
77
78 from "Str"
79 Treated as a time zone name or offset. See "USAGE" in
80 DateTime::TimeZone for more details on the allowed values.
81
82 Delegates to "new" in DateTime::TimeZone with the string as the
83 "name" argument.
84
86 MooseX::Types::DateTimeX
87
88 DateTime
89
91 Modern
92 Evan Carroll <me+cpan@evancarroll.com>
93
94 Yesteryear
95 Yuval Kogman <nothingmuch@woobling.org>
96
97 John Napiorkowski <jjn1056 at yahoo.com>
98
100 This module packages several Moose::Util::TypeConstraints with
101 coercions, designed to work with the DateTime suite of objects.
102
103 This module started as a fork of MooseX::Types::DateTime. This history
104 and explaination is as follows: In Janurary 2009, I began a project to
105 bring DateTime::Format::* stuff up to date with Moose. I created a
106 framework that would greatly eliminate redundant code named
107 DateTimeX::Format. This project's adoption was slowed by then (and
108 still currently) bundeled package MooseX::Types::DateTime.
109 MooseX::Types::DateTime was a badly packaged extention of two modules
110 the self-titled MooseX::Types::DateTime, and another random module
111 MooseX::Types::DateTimeX. In Februrary of the same year, I repackaged
112 the module MooseX::Types::DateTimeX with the authors blessing into a
113 new package, for the purpose of removing its dependenices, namely
114 Date::Manip, from MooseX::Types::DateTime.
115
116 Unfortunately, this just added confusion. Now, as of the time of
117 writing MooseX::Types::DateTimeX is available as a package, and it is
118 available as a module which will be installed by
119 MooseX::Types::DateTime. The benefit of removing the dependency on
120 MooseX::Types::DateTime was never realized and the patch that updates
121 the dependencies, and the build system remains in rt still as of
122 writing.
123
124 This module is just the MooseX::Types::DateTime without the requirement
125 on DateTimeX::Easy (which requires DateTime::Manip). As of 0.05 this
126 module supports globally unique Olson abbreviations, and dies when they
127 are not globally unique.
128
130 Copyright (c) 2008 Yuval Kogman. All rights reserved
131 This program is free software; you can redistribute
132 it and/or modify it under the same terms as Perl itself.
133
134 Modifications (c) 2009 Evan Carroll. All rights reserved
135 This program is free software; you can redistribute
136 it and/or modify it under the same terms as Perl itself.
137
138
139
140perl v5.38.0 2023M-o0o7s-e2X1::Types::DateTime::ButMaintained(3)