0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

QtでUNIX時刻から日付表記を得る

Posted at

どうしてこんな事を?

なんかよくわかんなかったんですがサンプルコードが欠片も見つけられなくてメソメソ…
サンプルコード無いと書けないマンなのだけれど、できたので、僕みたいな人向けにサンプルコードみたいな感じで書いておきます

QDateTime test_time;
test_time.setTime_t(1433984121);
qDebug()<<test_time.toString("yyyy/MM/dd hh:mm:ss");

出力は

"2015/06/11 09:55:21"

toString()の引数(上の例ではyyyy/MM/dd hh:mm:ss)でフォーマットを指定できる。詳しくは公式のドキュメント読んでください

こうやって見てみるとすんげー単純な話ですね!!!!!!つらさしかない

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?