I assume you mean that you have to print the latest time for each date.
Why not put the dates in a hash with the time as a value.
When you get an already defined hash key you can check to see if the time is later and update it.
Then, print out you list of hash and keys with whatever formatting you want.