in reply to Re: Script to display dates between range
in thread Script to display dates between range

Thanks a lot for replying.....if I am giving an input in terms of string dates in the form of yyyy-mm-dd then how to handle such a input in above code
  • Comment on Re^2: Script to display dates between range

Replies are listed 'Best First'.
Re^3: Script to display dates between range
by ikegami (Patriarch) on Mar 10, 2010 at 03:53 UTC
    You could use a regex to parse. You could use one of the DateTime::Format modules.
    use strict; use warnings; use DateTime::Format::ISO8601 qw( ); my $sdt = DateTime::Format::ISO8601->parse_datetime('2010-03-09'); my $edt = DateTime::Format::ISO8601->parse_datetime('2010-03-16'); for (my $dt = $sdt->clone(); $dt<=$edt; $dt->add( days => 1 )) { print($dt->ymd(), "\n"); }

    Or ...

      Thanks a lot.....I hope the above code will work for me.... God bless you !!!!