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::ISO8601(3pm)				User Contributed Perl Documentation			       MooseX::Types::ISO8601(3pm)

NAME
MooseX::Types::ISO8601 - ISO8601 date and duration string type constraints and coercions for Moose SYNOPSIS
use MooseX::Types::ISO8601 qw/ ISO8601TimeDurationStr /; has duration => ( isa => ISO8601TimeDurationStr, is => 'ro', coerce => 1, ); Class->new( duration => 60 ); # 60s => PT00H01M00S Class->new( duration => DateTime::Duration->new(%args) ) DESCRIPTION
This module packages several TypeConstraints with coercions for working with ISO8601 date strings and the DateTime suite of objects. DATE CONSTRAINTS
ISO8601DateStr An ISO8601 date string. E.g. "2009-06-11" ISO8601TimeStr An ISO8601 time string. E.g. "12:06:34Z" ISO8601DateTimeStr An ISO8601 combined datetime string. E.g. "2009-06-11T12:06:34Z" ISO8601DateTimeTZStr An ISO8601 combined datetime string with a fully specified timezone. E.g. "2009-06-11T12:06:34+00:00" COERCIONS The date types will coerce from: " Num " The number is treated as a time in seconds since the unix epoch " DateTime " The duration represented as a DateTime object. " Str " Non-expanded date and time string representations. e.g.:- 20120113 => 2012-01-13 170500Z => 17:05:00Z 20120113T170500Z => 2012-01-13T17:05:00Z Representations of UTC time zone (only an offset of zero is supported) e.g.:- 17:05:00+00:00 => 17:05:00Z 17:05:00+00 => 17:05:00Z 170500+0000 => 17:05:00Z 2012-01-13T17:05:00+00:00 => 2012-01-13T17:05:00Z 2012-01-13T17:05:00+00 => 2012-01-13T17:05:00Z 20120113T170500+0000 => 2012-01-13T17:05:00Z Also supports non-standards mixing of expanded and non-expanded representations e.g.:- 2012-01-13T170500Z => 2012-01-13T17:05:00Z 20120113T17:05:00Z => 2012-01-13T17:05:00Z DURATION CONSTRAINTS
ISO8601DateDurationStr An ISO8601 date duration string. E.g. "P01Y01M01D" ISO8601TimeDurationStr An ISO8601 time duration string. E.g. "PT01H01M01S" ISO8601DateTimeDurationStr An ISO8601 comboined date and time duration string. E.g. "P01Y01M01DT01H01M01S" COERCIONS The duration types will coerce from: " Num " The number is treated as a time in seconds " DateTime::Duration " The duration represented as a DateTime::Duration object. The duration types will coerce to: " Duration " A DateTime::Duration, i.e. the " Duration " constraint from MooseX::Types::DateTime. SEE ALSO
o MooseX::Types::DateTime o DateTime o DateTime::Duration o DateTime::Format::Duration VERSION CONTROL
http://github.com/bobtfish/moosex-types-iso8601/tree/master Patches are welcome. SEE ALSO
o http://en.wikipedia.org/wiki/ISO_8601 o http://dotat.at/tmp/ISO_8601-2004_E.pdf FEATURES
Fractional seconds If provided, the number of seconds in time types is represented to microsecond accuracy. A full stop character is used as the decimal seperator, which is allowed, but deprecated in preference to the comma character in ISO 8601:2004. BUGS
Probably full of them, patches are very welcome. Specifically missing features: o No timezone support - all times are assumed UTC o No week number type o "Basic format", which lacks seperator characters, is not supported for reading or writing. o Tests are rubbish. AUTHOR
Tomas Doran (t0m) "<bobtfish@bobtfish.net>" Dave Lambley "<davel@state51.co.uk>" The development of this code was sponsored by my employer <http://www.state51.co.uk>. Contributors Aaron Moses COPYRIGHT
Copyright (c) 2009 Tomas Doran. Some rights reserved. 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-05-11 MooseX::Types::ISO8601(3pm)
Man Page