Sort list by button

Hi folks… I’ve a problem, i need to sort my list(get from db) by date in 2 ways (old one and new one) by clicking on the same button.
For example the list is sort by newest to older, when i click i want to reverse order older to newest, and so on inthat way. How can i do?

ok i’ll do it…thank anyway