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 = "Y"; Console.WriteLine("'{0}' format specifier: {1}", fmt, thisDate.Date.ToString(fmt)); } } //'Y' format specifier: April, 2010