Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UNIX 時間 (例: 1295874681) を含む QString パラメーターを取り、QString を含む標準時刻形式 (例: Mon, 24 Jan 2011 13:11:21 GMT) に変換して返すエレガントな C++ 関数が必要です。
bool ok; const uint s = unixTimeStr.toUInt( &ok ); if ( !ok ) { ..handle conversion error (unixTimeStr not containing a number) } const QDateTime dt = QDateTime::fromTime_t( s ); const QString textdate = dt.toString( Qt::TextDate );