Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::formfu::inflator::datetime(3pm) [debian man page]

HTML::FormFu::Inflator::DateTime(3pm)			User Contributed Perl Documentation		     HTML::FormFu::Inflator::DateTime(3pm)

NAME
HTML::FormFu::Inflator::DateTime - DateTime inflator SYNOPSIS
--- elements: - type: Text name: start_date inflators: - type: DateTime parser: strptime: '%d-%m-%Y' strptime: pattern: '%d-%b-%Y' locale: de - type: Text name: end_time inflators: - type: DateTime time_zone: Europe/Rome parser: regex: '^ (d{2}) - (d{2}) - (d{4}) $' params: [day, month, year] strptime: '%d-%m-%Y' An example of using the same parser declaration for both a DateTime constraint and a DateTime inflator, using YAML references: --- elements: - type: Text name: date constraints: - type: DateTime parser: &PARSER strptime: '%d-%m-%Y' inflators: - type: DateTime parser: *PARSER DESCRIPTION
Inflate dates into DateTime objects. For a corresponding deflator, see HTML::FormFu::Deflator::Strftime. METHODS
parser Arguments: \%args Required. Define the expected input string, so DateTime::Format::Builder knows how to inflate it into a DateTime object. Accepts arguments to be passed to "parser" in DateTime::Format::Builder. strptime Arguments: \%args Arguments: $string Optional. Define the format that should be used if the DateTime object is stringified. time_zone Arguments: $string Optional. You can pass along a time_zone in which the DateTime will be created. This is useful if the string to parse does not contain time zone information and you want the DateTime to be in a specific zone instead of the floating one (which is likely). Accepts a hashref of arguments to be passed to "new" in DateTime::Format::Strptime. Alternatively, accepts a single string argument, suitable for passing to "DateTime::Format::Strptime->new( pattern => $string )". AUTHOR
Carl Franks, "cfranks@cpan.org" LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-23 HTML::FormFu::Inflator::DateTime(3pm)

Check Out this Related Man Page

Rose::DateTime::Parser(3pm)				User Contributed Perl Documentation			       Rose::DateTime::Parser(3pm)

NAME
Rose::DateTime::Parser - DateTime parser object. SYNOPSIS
use Rose::DateTime::Parser; $parser = Rose::DateTime::Parser->new(time_zone => 'UTC'); $dt = $parser->parse_date('4/30/2001 8am') or warn $parser->error; DESCRIPTION
Rose::DateTime::Parser encapsulates a particular kind of call to Rose::DateTime::Util's parse_date and parse_european_date functions. The object maintains the desired time zone, which is then passed to each call. This class inherits from, and follows the conventions of, Rose::Object. See the Rose::Object documentation for more information. CONSTRUCTOR
new PARAMS Constructs a new Rose::DateTime::Parser object based on PARAMS, where PARAMS are name/value pairs. Any object method is a valid parameter name. OBJECT METHODS
error [ERROR] Get or set the error message string. european [BOOL] Get or set a boolean value that controls how the parse_date method will interpret "xx/xx/xxxx" dates: either month/day/year or year/month/day. If true, then the parse_date method will pass its arguments to Rose::DateTime::Util's parse_european_date function, which interprets such dates as "dd/mm/yyyy". If false, then the parse_date method will temporarily force non-European date parsing and then call Rose::DateTime::Util's parse_date function, which will interpret the date as "mm/dd/yyyy". This attribute defaults to the value returned by the Rose::DateTime::Util->european_dates class method called at the time the Rose::DateTime::Parser object is constructed. If the BOOL argument is undefined (instead of "false, but defined") then the attribute will return to its default value by calling the Rose::DateTime::Util->european_dates class method again. To unambiguously set the attribute to true or false, pass a defined value like 1 or 0. parse_date STRING Attempt to parse STRING by passing it to Rose::DateTime::Util's parse_date or parse_european_date function. The choice is controlled by the european attribute. If parsing is successful, the resulting DateTime object is returned. Otherwise, error is set and false is returned. parse_datetime STRING This method is an alias for parse_date() parse_european_date STRING Attempt to parse STRING by passing it to Rose::DateTime::Util's parse_european_date function (regardless of the value of the european attribute). If parsing is successful, the resulting DateTime object is returned. Otherwise, error is set and false is returned. time_zone [STRING] Get or set the time zone string passed to Rose::DateTime::Util's parse_date function. Defaults to the value returned by the Rose::DateTime::Util->time_zone class method. AUTHOR
John C. Siracusa (siracusa@gmail.com) LICENSE
Copyright (c) 2010 by John C. Siracusa. 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.12.3 2010-03-23 Rose::DateTime::Parser(3pm)
Man Page