Link to home
Start Free TrialLog in
Avatar of kplonk
kplonk

asked on

How to comput the date

I have a date string like this

dd/mm/yyyy

and i need to be able to do computations on it, such as is this date newer than this one

both dates are strings in the above format

how do i do this in perl
ASKER CERTIFIED SOLUTION
Avatar of bebonham
bebonham

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bebonham
bebonham

actually, no, since perl is so flexable, it will return the greatest

1/2/3

3 ranked highest
then 1
then 2

Avatar of ozo
return $yeara <=> $yearb or $montha <=> $monthb or $daya <=> $dayb;

#or

return (join'',reverse split'/',$a) cmp (join'',reverse split'/',$b);
Avatar of kplonk

ASKER

Just th job