PDA

View Full Version : convert decimal seconds to QDateTime and back



mcarter
17th March 2010, 22:10
I have an application that is using decimal time in seconds. I want to use the QDateTimeEdit to display the value in a more readable format to allow a user to change the value. I then would like to retrieve the time back into a decimal time in seconds. I cannot see any convenient functions to convert back and forth.

Lykurg
17th March 2010, 22:51
Do you mean QDateTime::setTime_t() and QDateTime::toTime_t()?

mcarter
18th March 2010, 12:06
I need more precision than just seconds resolution . . . and I would prefer more than millisecond resolution, but I think I am asking for too much there. The decimal seconds I am using is a "double" value with the fractional part being the fractional seconds.