Hello Badri,

Soundararajan, Badrinarayanan wrote:
> Hi,
> 
(snipped)
> 
> Initially i used DateManip's DateCalc method, but that is hogging too
> much memory. 

Perhaps you could provide the code you have. 

> So i am trying to move to DateCalc.
> 
> Could you give me the basic logic and conditions to check for months
> between 2 dates 
> 

The RECIPES section of that module has something you could use?
How do I check whether a given date lies within a certain range of
dates?

  use Date::Calc qw( Date_to_Days );

  $lower = Date_to_Days($year1,$month1,$day1);
  $upper = Date_to_Days($year2,$month2,$day2);

  $date = Date_to_Days($year,$month,$day);

  if (($date >= $lower) && ($date <= $upper))
  {
      # ok
  }
  else
  {
      # not ok
  }

I hope this helps.

Ron

Reply via email to