C# DateTime DateTime(Int64, DateTimeKind)
Description
DateTime DateTime(Int64, DateTimeKind)
initializes
a new instance of the DateTime structure to a specified number of ticks and
to Coordinated Universal Time (UTC) or local time.
Syntax
DateTime.DateTime(Int64, DateTimeKind)
has the following syntax.
public DateTime(
long ticks,
DateTimeKind kind
)
Parameters
DateTime.DateTime(Int64, DateTimeKind)
has the following parameters.
ticks
- A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar.kind
- One of the enumeration values that indicates whether ticks specifies a local time, Coordinated Universal Time (UTC), or neither.
Example
The following code shows how to use DateTime.DateTime(Int64, DateTimeKind)
.
/*from ww w.j a v a 2s . co m*/
using System;
using System.Globalization;
class Sample
{
public static void Main()
{
DateTime dt1 = new DateTime(111111111,DateTimeKind.Unspecified);
Console.WriteLine(dt1);
}
}
The code above generates the following result.