#include <QtCore>#include <QtDebug> int main(){ uint x = 1194278852; qDebug() << QDateTime::fromTime_t(x); return 0;}
QDateTime unixtime2datetime(QString strUnixDate) { return QDateTime::fromTime_t(strUnixDate.toLongLong()/1000); }qDebug()<<unixtime2datetime("1246012546357");
C++ (Qt) QDateTime unixtime2datetime(QString strUnixDate) { QDateTime dt(QDateTime::fromTime_t(strUnixDate.toLongLong()/1000)); dt.addMSecs(strUnixDate.toLongLong()%1000); return dt; }