My first Daniweb question!! Am at the front end of learning Python (3.2.3)
I'm doing a SQL query into a MySQL database for two fields, track_ID and track_duration. I'm getting a return of both, but instead of the duration value being expressed as 00:02:50, as it is stored in the database, my Python call is returning it as datetime.timedelta(0,170). I realize that is 170 seconds and is correct, but would like to replicate the formatting in the db.
How do I get it to return it in the form it was stored, instead of the datetime.timedelta function?
MySQL call is: cur.execute("Select track_id, track_duration from tracks where track_id = 342") track_duration is stored in my db as a time data type.