Number::Compare::Date - Like Number::Compare, but for epoch seconds
use Number::Compare::Date; my $y2k = Number::Compare::Date->new(">=2000-01-01"); if ($y2k->(time)) { print "Run for the hills, the y2k bug's gonna eat you " }
A simple extension to Number::Compare that allows you to compare dates against numbers (which should be epoch seconds.) The value that is compared can either be epoch seconds:
my $perl583 = Number::Compare::Date->new("<1072915199");
Or it can be anything Date::Parse can recognise:
my $perl583 = Number::Compare->new('<Wed, 31 Dec 2003 23:59:59');
If you don't use a comparison operator (<, <=, >= or >), then the module will check if the date is equal.
<
<=
>=
>
See Date::Parse for more formats.
Written by Mark Fowler <mark@twoshortplanks.com>
Copyright Profero 2003. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Doesn't cope with anything outside the epoch range on your machine. Isn't DateTime compatible.
Bugs should be reported to the open source development team at Profero via the CPAN RT system.
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Number::Compare::Date.
Date::Parse, Number::Compare
To install Number::Compare::Date, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Number::Compare::Date
CPAN shell
perl -MCPAN -e shell install Number::Compare::Date
For more information on module installation, please visit the detailed CPAN module installation guide.