> Hi all, > > Need some advise please on how do date arithmetic/calculation. > > Basically, I have a CSV delimited file that I need to do some date > calculations on. > > Am parsing the fields as $date1 and $date2 and I need to do the time > difference as $date2-$date1 > > Example of $date1 and $date2 below: > > $date1="31/12/2009 6:14:25 p.m." > $date2="31/12/2009 6:29:26 p.m." > > Am still Googling and posting this at the same time ... :-) > > Any suggestion will be very much appreciated. Thanks in advance.
You would be advised to look at the perl modules, Date::Calc or Date::Manip Having extracted your date, you need to get the day, month and year and then feed that into Date::Calc , eg; use Date::Calc qw(Delta_Days); $Dd = Delta_Days($year1,$month1,$day1,$year2,$month2,$day2); -- Owen -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/