hello all
i have unix timestamp and i need to convert it to Human readable data + time
how can it be done in QT ?
views:
170answers:
2
+2
A:
int unixTime = 1234567890;
QDateTime timestamp;
timestamp.setTime_t(unixTime);
qDebug() << timestamp.toString(Qt::SystemLocaleShortDate);
That should get you going. Like Matthew said, see QDateTime.setTime_t, as well as QDateTime.toString. The toString has an enumeration with several different options, as well as an overload where you can pass a string allowing however much customization you like.
Jake Petroules
2010-05-29 12:56:10