DateTimeFormatInfo.RFC1123Pattern Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the custom date and time format string that is based on the Internet Engineering Task Force (IETF) Request for Comments (RFC) 1123 specification and is associated with the "r" and "R" standard format strings.

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public ReadOnly Property RFC1123Pattern As String
public string RFC1123Pattern { get; }

Property Value

Type: System..::.String
The custom date and time format string that is based on the IETF RFC 1123 specification. The string is invariant; it does not vary by cultures.

Examples

The following example displays the value of RFC1123Pattern for a few cultures.

Imports System.Globalization

Public Class Example
   Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
      ' Displays the values of the pattern properties.
      outputBlock.Text &= " CULTURE    PROPERTY VALUE" & vbCrLf
      PrintPattern(outputBlock, "en-US")
      PrintPattern(outputBlock, "ja-JP")
      PrintPattern(outputBlock, "fr-FR")
   End Sub

   Public Shared Sub PrintPattern(ByVal outputBlock As System.Windows.Controls.TextBlock, ByVal myCulture As [String])
      Dim myDTFI As DateTimeFormatInfo = New CultureInfo(myCulture).DateTimeFormat
      outputBlock.Text += String.Format("  {0}     {1}", myCulture, myDTFI.RFC1123Pattern) & vbCrLf
   End Sub 
End Class
' This example produces the following output.
'       CULTURE    PROPERTY VALUE
'        en-US     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
'        ja-JP     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
'        fr-FR     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
using System;
using System.Globalization;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      // Displays the values of the pattern properties.
      outputBlock.Text += " CULTURE    PROPERTY VALUE" + "\n";
      PrintPattern(outputBlock, "en-US");
      PrintPattern(outputBlock, "ja-JP");
      PrintPattern(outputBlock, "fr-FR");
   }

   public static void PrintPattern(System.Windows.Controls.TextBlock outputBlock, String myCulture)
   {
      DateTimeFormatInfo myDTFI = new CultureInfo(myCulture).DateTimeFormat;
      outputBlock.Text += String.Format("  {0}     {1}", myCulture, myDTFI.RFC1123Pattern) + "\n";
   }
}
/*
This example produces the following output.
       CULTURE    PROPERTY VALUE
        en-US     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
        ja-JP     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
        fr-FR     ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
*/

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

DateTimeFormatInfo Class

System.Globalization Namespace