C# DateTimeOffset DateTime
Description
DateTimeOffset DateTime
gets a DateTime value that represents
the date and time of the current DateTimeOffset object.
Syntax
DateTimeOffset.DateTime
has the following syntax.
public DateTime DateTime { get; }
Example
The following example illustrates the use of the DateTime property to convert the time returned by the Now and UtcNow properties to DateTime values.
using System;/* w w w . j a v a 2 s .c o m*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset offsetDate;
DateTime regularDate;
offsetDate = DateTimeOffset.Now;
regularDate = offsetDate.DateTime;
Console.WriteLine("{0} converts to {1}, Kind {2}.",
offsetDate.ToString(),
regularDate,
regularDate.Kind);
}
}
The code above generates the following result.