Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

moosex::types::datetime(3pm) [mojave man page]

MooseX::Types::DateTime(3pm)				User Contributed Perl Documentation			      MooseX::Types::DateTime(3pm)

NAME
MooseX::Types::DateTime - DateTime related constraints and coercions for Moose VERSION
version 0.10 SYNOPSIS
Export Example: use MooseX::Types::DateTime qw(TimeZone); has time_zone => ( isa => TimeZone, is => "rw", coerce => 1, ); Class->new( time_zone => "Africa/Timbuktu" ); Namespaced Example: use MooseX::Types::DateTime; has time_zone => ( isa => 'DateTime::TimeZone', is => "rw", coerce => 1, ); Class->new( time_zone => "Africa/Timbuktu" ); DESCRIPTION
This module packages several Moose::Util::TypeConstraints with coercions, designed to work with the DateTime suite of objects. CONSTRAINTS
DateTime A class type for DateTime. from "Num" Uses "from_epoch" in DateTime. Floating values will be used for sub-second precision, see DateTime for details. from "HashRef" Calls "new" in DateTime with the hash entries as arguments. Duration A class type for DateTime::Duration from "Num" Uses "new" in DateTime::Duration and passes the number as the "seconds" argument. Note that due to leap seconds, DST changes etc this may not do what you expect. For instance passing in 86400 is not always equivalent to one day, although there are that many seconds in a day. See "How Date Math is Done" in DateTime for more details. from "HashRef" Calls "new" in DateTime::Duration with the hash entries as arguments. DateTime::Locale A class type for DateTime::Locale::root with the name DateTime::Locale. from "Str" The string is treated as a language tag (e.g. "en" or "he_IL") and given to "load" in DateTime::Locale. from Locale::Maktext The "Locale::Maketext/language_tag" attribute will be used with "load" in DateTime::Locale. DateTime::TimeZone A class type for DateTime::TimeZone. from "Str" Treated as a time zone name or offset. See "USAGE" in DateTime::TimeZone for more details on the allowed values. Delegates to "new" in DateTime::TimeZone with the string as the "name" argument. SEE ALSO
MooseX::Types::DateTime::MoreCoercions DateTime, DateTimeX::Easy AUTHOR
Yuval Kogman <nothingmuch@woobling.org> John Napiorkowski <jjn1056 at yahoo.com> COPYRIGHT
Copyright (c) 2008 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-02-03 MooseX::Types::DateTime(3pm)

Check Out this Related Man Page

MooseX::Types::DateTime::MoreCoercions(3pm)		User Contributed Perl Documentation	       MooseX::Types::DateTime::MoreCoercions(3pm)

NAME
MooseX::Types::DateTime::MoreCoercions - Extensions to MooseX::Types::DateTime SYNOPSIS
package MyApp::MyClass; use MooseX::Types::DateTime::MoreCoercions qw( DateTime ); has created => ( isa => DateTime, is => "rw", coerce => 1, ); my $instance = MyApp::MyClass->new(created=>'January 1, 1980'); print $instance->created->year; # is 1980 ## Coercions from the base type continue to work as normal. my $instance = MyApp::MyClass->new(created=>{year=>2000,month=>1,day=>10}); Please see the test case for more example usage. DESCRIPTION
This module builds on MooseX::Types::DateTime to add additional custom types and coercions. Since it builds on an existing type, all coercions and constraints are inherited. SUBTYPES
This module defines the following additional subtypes. DateTime Subtype of "DateTime" in MooseX::Types::DateTime. Adds an additional coercion from strings. Uses DateTimeX::Easy to try and convert strings, like "yesterday" into a valid DateTime object. Please note that due to ambiguity with how different systems might localize their timezone, string parsing may not always return the most expected value. IN general we try to localize to UTC whenever possible. Feedback welcomed! Duration Subtype of "Duration" in MooseX::Types::DateTime that coerces from a string. We use the module Time::Duration::Parse to attempt this. CAVEATS
Firstly, this module uses DateTimeX::Easy which is way to more DWIM than any sane person would desire. DateTimeX::Easy works by falling back until something makes sense, this is variable. Furthermore, all the modules that DateTimeX::Easy *can* use aren't required for "proper" function of DateTimeX::Easy. What does this mean? Simple, your mileage may vary in your coercions because DateTimeX::Easy is installation specific. SEE ALSO
o MooseX::Types::DateTime Replacement for this module -- coercions with less voodoo o DateTimeX::Easy Backend of this module o Time::Duration::Parse Duration parsing backend for this module AUTHOR
John Napiorkowski <jjn1056 at yahoo.com> Broken into a separate package from MooseX::Types::DateTime by Evan Carroll. Forked from MooseX::Types::DateTimeX and ported back to use MooseX::Types::DateTime by Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org>. LICENSE
Copyright (c) 2008 John Napiorkowski. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-06 MooseX::Types::DateTime::MoreCoercions(3pm)
Man Page