Get DateTime value that represents the date and time of the current DateTimeOffset in CSharp
Description
The following code shows how to get DateTime value that represents the date and time of the current DateTimeOffset.
Example
using System;/*from w w w . j av a2 s. com*/
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.