in reply to Comparing two dates and getting back difference in days

So many Date and Time modules to try, so little time :)
  • Comment on Re: Comparing two dates and getting back difference in days

Replies are listed 'Best First'.
Re: Re: Comparing two dates and getting back difference in days
by Anonymous Monk on Jan 21, 2004 at 18:26 UTC
    That's how it used to be before DateTime. That's why there is only DateTime now.
    use DateTime; use strict; use warnings; my $str = "2004-01-14"; my( $y, $m, $d ) = split /\D/,$str; my $delta = DateTime->new( year => $y, month => $m, day => $d, )->delta_days( DateTime->now(), ); die $delta->days; __END__ 0 at datetime4.pl line 16.
      DateTime homepage

      Is there an ActiveState repository with it?


      The PerlMonk tr/// Advocate
        DateTime failed to compile as a module for Perl 5.8 as per ActiveState's Build page.

        For Perl 5.6 it only exists as a ppm for the hpux-pa-risc.

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law