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 <>

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.


Date::Parse, Number::Compare