Create DateTime from year, month, day, hour, minute, second, and millisecond in CSharp
Description
The following code shows how to create DateTime from year, month, day, hour, minute, second, and millisecond.
Example
// w w w. j a v a 2 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);
System.Console.WriteLine(date1.ToString("M/dd/yyyy h:mm:ss.fff tt"));
}
}
The code above generates the following result.