in reply to 3 days previous Date

That looks like Date::Manip. I'm not familiar with that module and the docs aren't straightforward, so I'm going to give an answer using the module I use: DateTime.

my $dt = DateTime->today->subtract( days => 3 );

Replies are listed 'Best First'.
Re^2: 3 days previous Date
by bharatbsharma (Acolyte) on Jun 16, 2010 at 04:48 UTC
    I used like this in my one of the script
    #!/usr/bin/perl sub _timestamp { my $diff = shift; my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime(time - $di +ff); $mon++; return sprintf("%d-%02d-%02d",($year + 1900),$mon,$mday); } $pre=259200; # 24*60*3 $myTimeStamp = _timestamp ($pre); print "$myTimeStamp \n";
    bharat

      Aside from

      $pre=24*60*60*3;
      being much clearer than
      $pre=259200; # 24*60*3

      not every day has 24*60*60 seconds. Your code is buggy.