An all-nighter is NOT simply staying up until the sun rises, then sleeping.
The term is popular with college students who spend the night before an exam studying (or 'cramming'), trying to learn a lot of material in a short period of time. The term is frequently used in the phrase 'pull an all-nighter'.
2) I pulled an all-nighter to study for my math exam.
"Totally---I was able to buy the book for the class yesterday and I pulled an "all nighter."