html::formfu::constraint::datetime(3pm) [debian man page]
HTML::FormFu::Constraint::DateTime(3pm) User Contributed Perl Documentation HTML::FormFu::Constraint::DateTime(3pm)NAME
HTML::FormFu::Constraint::DateTime - DateTime constraint
SYNOPSIS ---
elements:
- type: Text
name: start_date
constraints:
- type: DateTime
parser:
strptime: '%d-%m-%Y'
- type: Text
name: end_time
constraints:
- type: DateTime
parser:
regex: !!perl/regexp '^(d{2}) - (d{2}) - (d{4})$'
params: [day, month, year]
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
Ensure input can later be inflated to a DateTime object.
METHODS
parser
Arguments: \%args
Required. Define the expected input string, so DateTime::Format::Builder knows how to turn it into a DateTime object.
Accepts arguments to be passed to "parser" in DateTime::Format::Builder.
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 2011-05-10 HTML::FormFu::Constraint::DateTime(3pm)
Check Out this Related Man Page
HTML::FormFu::Inflator::CompoundDateTime(3pm) User Contributed Perl Documentation HTML::FormFu::Inflator::CompoundDateTime(3pm)NAME
HTML::FormFu::Inflator::CompoundDateTime - CompoundDateTime inflator
SYNOPSIS ---
element:
- type: Multi
name: date
elements:
- name: day
- name: month
- name: year
inflator:
- type: CompoundDateTime
# get the submitted value as a DateTime object
my $date = $form->param_value('date');
DESCRIPTION
For use with a HTML::FormFu::Element::Multi group of fields.
Changes the input from several fields into a single DateTime value.
By default, expects the field names to be any of the following:
year
month
day
hour
minute
second
nanosecond
time_zone
METHODS
field_order
Arguments: @order
If your field names doesn't follow the convention listed above, you must provide an arrayref containing the above names, in the order they
correspond with your own fields.
---
element:
- type: Multi
name: date
elements:
- name: m
- name: d
- name: y
inflator:
- type: CompoundDateTime
field_order:
- month
- day
- year
strptime
Arguments: \%args
Arguments: $string
Optional. Define the format that should be used if the DateTime object is stringified.
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 )".
---
inflator:
- type: CompoundDateTime
strptime:
pattern: '%d-%b-%Y'
locale: de
---
inflator:
- type: CompoundDateTime
strptime: '%d-%m-%Y'
AUTHOR
Carl Franks
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::CompoundDateTime(3pm)
I am completely new to perl and am just going over the tutorials right now. What I am trying to attempt is to take the input from the HTML (in a form) and use those variables in a perl script. I've looked everywhere for a simple example on how to do this and cannot find it or do not understand... (5 Replies)
Hey Guys,
I have looked for a solution throughout the forum for my particular question, but I cant find one. So I'm sorry if I overlooked it. I need to be able to 48 add hours to a particular DateTime string.
I have a variable named $startTime
I would like to be able to take that... (1 Reply)
The perl parser below works as expected assuming the last digit in the NC_ before the . is a single digit.
perl -ne 'next if $. == 1;
if(/.*del(+)ins(+).*NC_0{4}(+).*g\.(+)_(+)/) # indel
{
print join("\t", $3, $4, $5, $1, $2), "\n";
}
' out_position.txt > out1.txt
... (8 Replies)