.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::FormFu::Inflator::DateTime 3pm" .TH HTML::FormFu::Inflator::DateTime 3pm "2019-01-12" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::FormFu::Inflator::DateTime \- DateTime inflator .SH "VERSION" .IX Header "VERSION" version 2.07 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 11 \& \-\-\- \& elements: \& \- type: Text \& name: start_date \& inflators: \& \- type: DateTime \& parser: \& strptime: \*(Aq%d\-%m\-%Y\*(Aq \& strptime: \& pattern: \*(Aq%d\-%b\-%Y\*(Aq \& locale: de \& \& \- type: Text \& name: end_time \& inflators: \& \- type: DateTime \& time_zone: Europe/Rome \& parser: \& regex: \*(Aq^ (\ed{2}) \- (\ed{2}) \- (\ed{4}) $\*(Aq \& params: [day, month, year] \& strptime: \*(Aq%d\-%m\-%Y\*(Aq .Ve .PP An example of using the same parser declaration for both a DateTime constraint and a DateTime inflator, using \s-1YAML\s0 references: .PP .Vb 11 \& \-\-\- \& elements: \& \- type: Text \& name: date \& constraints: \& \- type: DateTime \& parser: &PARSER \& strptime: \*(Aq%d\-%m\-%Y\*(Aq \& inflators: \& \- type: DateTime \& parser: *PARSER .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Inflate dates into DateTime objects. .PP For a corresponding deflator, see HTML::FormFu::Deflator::Strftime. .SH "METHODS" .IX Header "METHODS" .SS "parser" .IX Subsection "parser" Arguments: \e%args .PP Required. Define the expected input string, so DateTime::Format::Builder knows how to inflate it into a DateTime object. .PP Accepts arguments to be passed to \*(L"parser\*(R" in DateTime::Format::Builder. .SS "strptime" .IX Subsection "strptime" Arguments: \e%args .PP Arguments: \f(CW$string\fR .PP Optional. Define the format that should be used if the DateTime object is stringified. .SS "time_zone" .IX Subsection "time_zone" Arguments: \f(CW$string\fR .PP 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). .PP Accepts a hashref of arguments to be passed to \&\*(L"new\*(R" in DateTime::Format::Strptime. Alternatively, accepts a single string argument, suitable for passing to \&\f(CW\*(C`DateTime::Format::Strptime\->new( pattern => $string )\*(C'\fR. .SH "AUTHOR" .IX Header "AUTHOR" Carl Franks, \f(CW\*(C`cfranks@cpan.org\*(C'\fR .SH "LICENSE" .IX Header "LICENSE" This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" Carl Franks .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018 by Carl Franks. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.