Qt seconds to DD HH SS
using Qt 4.8 how can I print the time in the format DD HH SS? I have the seconds and I want to get back a string in that format. cor3ntin QDateTime::fromTime_t(seconds).toString("ss hh DD"); see http://qt-project.org/doc/qt-5.0/qdatetime.html#toString If you want a duration ( your question was really unclear) try something like : QString seconds_to_DHMS(quint32 duration) { QString res; int seconds = (int) (duration % 60); duration /= 60; int minutes = (int) (duration % 60); duration /= 60; int hours = (int) (duration % 24); int days = (int) (duration / 24); if((hours == 0)&&(days == 0)) return