Even easier is to use Date::Parse.

use Date::Parse;

$var1 = '2002-02-01';
$var2 = '2002-02-28';

print abs( str2time($var1) - str2time($var2) ) / 86400;

Rob

-----Original Message-----
From: Imtiaz ahmad [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 4:19 PM
To: '[EMAIL PROTECTED]'
Subject: days calculation


Hi-

Does anyone know how to calculate number of days if the dates are
'2002-02-01' '2002-02-28'?

In other words, if var1='2002-02-01' and var2='2002-02-28' then
how can we say days=var2-var1?

thanks.

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

Reply via email to