I am using Qt5.6, MSVC2013 32bit on Windows as well as Qt5.4, 64 bit on Ubuntu. I am trying to parse Journal syslog to convert _SOURCE_REALTIME_TIMESTAMP into human readable text. Somehow the millisecond is all 0. Wondering what is correct way to show milliseconds or even microseconds?
bool ok;
QString ss = "1462962462893977";
const qlonglong s = ss.toLongLong(&ok );
if ( !ok ) {
qDebug() << "Error1";
}
const QDateTime dt = QDateTime::fromTime_t( s/1000000 );
const QString textdate = dt.toString( "yyyy-MM-dd hh:mm:ss.zzz" );
qDebug() <<"==>" << textdate;
Result from PC/UBuntu is ==> "2016-05-11 03:27:42.000" The milliseconds are all 0's which I expect to have numbers.
Thanks!