5
4

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.

日付のミリ秒を文字列にする

Posted at

方法: 日付および時刻の値のミリ秒部分を表示する

書式 後続のゼロ埋め
f ゼロ埋めする
F ゼロ埋めしない
DateTime dateValue = new DateTime(2008, 7, 16, 8, 32, 45, 180); 
Console.WriteLine(dateValue.ToString("fff"));  // 180を出力
Console.WriteLine(dateValue.ToString("FFF"));  // 18を出力

WindowsCE では、DateTimeではミリ秒は取得できない。
System.Environment.TickCount プロパティによりミリ秒を取得する。

5
4
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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?