CSharp examples for System:DateTime Format
Formats given datetime instance according to RFC 1123 specification and returns formatted date as a string.
using System.Globalization; using System;//from w w w . ja va 2 s .c om public class Main{ /// <summary> /// <para>Formats given date/time instance according to RFC 1123 specification and returns formatted date as a string.</para> /// </summary> /// <param name="self">Date/time object instance.</param> /// <returns>Formatted date/time value as a string.</returns> /// <seealso cref="DateTimeFormatInfo"/> public static string RFC1121(this DateTime self) { return self.ToString("r"); } }