When I was younger I could do it easily too, hack through the night with the power of some caffeinated cola drinks, easily doing 12h hackathons. When I was 16 to about 20 years old, that is.
Nowadays it's a bit different. My body just can't take the sitting in front of the computer for so long. Maybe it's a good thing though, but it really makes me want to think about how I spend my time on the computer and seek those creative hours when I am able to get into the zone and just code.
Usually I find myself doing from anywhere to 2 to 4 hours of concentrated creative work a day, and that's it.