DateTimeOffset format: d
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 = "d";
Console.WriteLine("'{0}' format specifier: {1}", fmt, thisDate.Date.ToString(fmt));
}
}
//'d' format specifier: 4/17/2010
Related examples in the same category