How to get the last executed transaction?
The first transaction in the list should be the newest one.

The best way to answer such questions is always to read the source code. getTransactionsByTime calls getRecentTransactions, and there is a comment:


  Returns an list of N transactions, ordered by increasing age.


You can trace down to find the critical minus sign that ensures this.

You can also find a test that explicitly verifies it works as documented.