qdatetime :: fromstringは無効な日付を返します、私は何が欠けていますか?

StackOverflow https://stackoverflow.com/questions/8927963

  •  30-10-2019
  •  | 
  •  

質問

SQLiteデータベースからDateTimeを読み取るコードがいくつかあります。DateTimeは文字列として返されます。 QDateTime :: FromStringを使用して日付に変換しようとすると、無効な日付が返されます。以下は、データベースと変換から返される時間です。なぜこれが解析できないのですか?

// -this is the value returned from the DB currentServerTime=2012-01-17 19:20:27.0

QString format("yyyy/MM/dd hh:mm:ss");
QString qCurrentServerTime(currentServerTime);
now = QDateTime::fromString(qCurrentServerTime, format);

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top