Adding times
Posted: Tue Feb 03, 2004 4:17 pm
Hello,
I'm currently writing a script which logs all the tracks I play on winamp into a mysql database, I've got all that working fine, but want to display some stats on a page, and the one I'm stuck on is total playing time.
In the database on each row with the track title, artist, album is the track length in the fashion mins:seconds in a column called length.
For the stats page how can I add together all the track times from the length column to give a total playing time in hours:mins:seconds, or even better, days:hours:mins:seconds?
Thanks.
I'm currently writing a script which logs all the tracks I play on winamp into a mysql database, I've got all that working fine, but want to display some stats on a page, and the one I'm stuck on is total playing time.
In the database on each row with the track title, artist, album is the track length in the fashion mins:seconds in a column called length.
For the stats page how can I add together all the track times from the length column to give a total playing time in hours:mins:seconds, or even better, days:hours:mins:seconds?
Thanks.