Over a million developers have joined DZone.

Display DateTime Up To Milliseconds

·
Format string "ffff" is responsible for displaying milliseconds.


 string myTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss:ffff");
 Console.WriteLine(myTime);
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}