DateTimeOffset custom format specifier: dd MMM yyyy
using System;
public class Test
{
public static void Main()
{
DateTimeOffset thisDate = new DateTimeOffset(2010, 4, 17, 2, 32, 0, new TimeSpan(-5, 0, 0));
string fmt;
fmt = "dd MMM yyyy";
Console.WriteLine("'{0}' format specifier: {1}", fmt, thisDate.Date.ToString(fmt));
}
}
//'Y' format specifier: April, 2010
Related examples in the same category