Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

moosex::types::datetime5.16(3) [osx man page]

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

MooseX::Types::DateTime - DateTime related constraints and coercions for Moose 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 subsecond percision, 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::DateTimeX DateTime, DateTimeX::Easy VERSION CONTROL
This module is maintained using git. You can get the latest version from git:// <git://>. AUTHOR
Yuval Kogman <> John Napiorkowski <jjn1056 at> 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.16.2 2011-12-12 MooseX::Types::DateTime(3)

Check Out this Related Man Page

DateTime::TimeZone::Local(3)				User Contributed Perl Documentation			      DateTime::TimeZone::Local(3)

DateTime::TimeZone::Local - Determine the local system's time zone VERSION
version 1.63 SYNOPSIS
my $tz = DateTime::TimeZone->new( name => 'local' ); my $tz = DateTime::TimeZone::Local->TimeZone(); DESCRIPTION
This module provides an interface for determining the local system's time zone. Most of the functionality for doing this is in OS-specific subclasses. USAGE
This class provides the following methods: DateTime::TimeZone::Local->TimeZone() This attempts to load an appropriate subclass and asks it to find the local time zone. This method is called by when you pass "local" as the time zone name to "DateTime:TimeZone->new()". If your OS is not explicitly handled, you can create a module with a name of the form "DateTime::TimeZone::Local::$^O". If it exists, it will be used instead of falling back to the Unix subclass. If no OS-specific module exists, we fall back to using the Unix subclass. See DateTime::TimeZone::Local::Unix, DateTime::TimeZone::Local::Win32, and DateTime::TimeZone::Local::VMS for OS-specific details. SUBCLASSING
If you want to make a new OS-specific subclass, there are several methods provided by this module you should know about. $class->Methods() This method should be provided by your class. It should provide a list of methods that will be called to try to determine the local time zone. Each of these methods is expected to return a new "DateTime::TimeZone" object if it determines the time zone. $class->FromEnv() This method tries to find a valid time zone in an %ENV value. It calls "$class->EnvVars()" to determine which keys to look at. To use this from a subclass, simply return "FromEnv" as one of the items from "$class->Methods()". $class->EnvVars() This method should be provided by your subclass. It should return a list of env vars to be checked by "$class->FromEnv()". $class->_IsValidName($name) Given a possible time zone name, this returns a boolean indicating whether or not the name looks valid. It always return false for "local" in order to avoid infinite loops. EXAMPLE SUBCLASS
Here is a simple example subclass: package DateTime::TimeZone::SomeOS; use strict; use warnings; use base 'DateTime::TimeZone::Local'; sub Methods { qw( FromEnv FromEther ) } sub EnvVars { qw( TZ ZONE ) } sub FromEther { my $class = shift; ... } AUTHOR
This software is copyright (c) 2013 by Dave Rolsky. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.16.3 2013-10-28 DateTime::TimeZone::Local(3)
Man Page

Featured Tech Videos