Sort output by date