NAME
Data::Validate::Date - date validation methods
VERSION
Version 0.01
SYNOPSIS
use Data::Validate::Date;
my $test = Data::Validate::Date->new;
my $re = $test->is_date("YYYYMMDD"); # or
my $re = $test->is_date("YYYY-MM-DD");
print $re ? "Valid date" : "Invalid date";
METHODS
new()
Create the object.
my $test = Data::Validate::Date->new;
is_date()
Validate the given date is valid or not, return 1 for true, undef for false. It accepts two forms of date, one is "YYYYMMDD", another is ""YYYY-MM-DD". So the below invoking are right.
$test->is_date("20101231");
$test->is_date("2010-12-31")
$test->is_date("20110101")
$test->is_date("2011-01-01")
$test->is_date("2011-1-1")
SEE ALSO
Time::Local
AUTHOR
Peng Yong Hua <pyh@mail.nsbeta.info>
BUGS/LIMITATIONS
If you have found bugs, please send email to <pyh@mail.nsbeta.info>
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Data::Validate::Date
COPYRIGHT & LICENSE
Copyright 2011 Peng Yong Hua, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.