using System;
using System.Globalization;
public class Example
{
public static void Main()
{
DateTimeOffset thisDate;
// Show output for UTC time
thisDate = DateTimeOffset.UtcNow;
Console.WriteLine(thisDate.ToString());
// Show output for local time
thisDate = DateTimeOffset.Now;
Console.WriteLine(thisDate.ToString());
// Show output for arbitrary time offset
thisDate = thisDate.ToOffset(new TimeSpan(-5, 0, 0));
Console.WriteLine(thisDate.ToString());
}
}