You forgot to comment why you are dividing by 86400. (I learned the hard way, and still can't figure out how some of my old uncommented code works.)
-----Original Message----- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 5:04 PM To: 'Imtiaz ahmad'; '[EMAIL PROTECTED]' Subject: RE: days calculation 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] ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]