Sort the transactions by time