Custom DateTime format MM/dd/yyy hh:mm:ss.fff in CSharp
Description
The following code shows how to custom DateTime format MM/dd/yyy hh:mm:ss.fff.
Example
/*from w w w . ja va 2s.co m*/
using System;
public class MainClass{
public static void Main(String[] argv){
DateTime date3 = new DateTime(2008, 1, 1, 0, 30, 45, 125);
Console.WriteLine("Date with milliseconds: {0:MM/dd/yyy hh:mm:ss.fff}",
date3);
}
}
The code above generates the following result.