Create DateTime structure from year, month, day, hour, minute, second, millisecond at Coordinated Universal Time (UTC) or local time in CSharp
Description
The following code shows how to create DateTime structure from year, month, day, hour, minute, second, millisecond at Coordinated Universal Time (UTC) or local time.
Example
/*from w w w . j a v a2 s .c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
DateTime date1 = new DateTime(2010, 8, 18, 16, 32, 18, 500,
DateTimeKind.Local);
System.Console.WriteLine("{0:M/dd/yyyy h:mm:ss.fff tt} {1}", date1, date1.Kind);
}
}
The code above generates the following result.