Sandeep Shinagare wrote:
> 
> Hi All,
> I am trying to find the date, month and year of the next Monday given any
> day.
> I am using this to  get todays date/day/month etc. Is there a way to use
> this
> information to get the next Monday?
> 
> #snip-start
>  $thisday=(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime)[6]];
>  $thisdate=(localtime)[3];
> 
> $thismonth=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sept,Oct,Nov,Dec)[(localtime)[4]
> ];
>  $thisyear=(localtime)[5] + 1900;
> #snip-end


use Time::Local;

my @date = localtime;
$date[3] += 8 - $date[6];

print scalar localtime( timelocal( @date ) ), "\n";



John
-- 
use Perl;
program
fulfillment

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

Reply via email to