Create DateTime from year, month, day, hour, minute, second at Coordinated Universal Time (UTC) or local time in CSharp
Description
The following code shows how to create DateTime from year, month, day, hour, minute, second at Coordinated Universal Time (UTC) or local time.
Example
// w w w. ja v a2 s .c om
using System;
public class MainClass{
public static void Main(String[] argv){
DateTime date1 = new DateTime(2010, 8, 18, 16, 32, 0, DateTimeKind.Local);
System.Console.WriteLine("{0} {1}", date1, date1.Kind);
}
}
The code above generates the following result.