Hi!

The module Date::Calc provides a function AddDelta_Days().

It works like:

  ($year,$month,$day) = Add_Delta_Days($year,$month,$day, $Dd);

where the result is a list consisting of  year, month and date; the
arguments to the function are another year, month, date and a difference
number of days - which, in your case, can be -20.

So your problem could be solved like:

  #!/usr/bin/perl -w
  use Date::Calc;

  ($sec,$min,$hour,$mday,$mon,$year) = localtime (time);
  ($oldyear, $oldmonth, $oldday) = Add_Delta_Days ($year, $month, $day,
-20);


Regards

Sascha

----------
>Von: "shweta shah" <[EMAIL PROTECTED]>
>An: <[EMAIL PROTECTED]>
>Betreff: how to get date before say 20 days ?
>Datum: Die, 24. Jul 2001 13:24 Uhr
>

> hello,
> is there something in perl  through which i can get
> date previous to some specified days ,say 20 days befores date
> i need to know only dd-mm-yy and not time
> is there any module  function for it
> thanks
> shweta
>
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to