.NET Framework Class Library for Silverlight
DateTimeFormatInfo..::.FullDateTimePattern Property

Gets or sets the custom format string for a long date and long time value, which is associated with the "F" standard date and time format string.

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

Visual Basic (Declaration)
Public Property FullDateTimePattern As String
    Get
    Set
Visual Basic (Usage)
Dim instance As DateTimeFormatInfo
Dim value As String

value = instance.FullDateTimePattern

instance.FullDateTimePattern = value
C#
public string FullDateTimePattern { get; set; }

Property Value

Type: System..::.String
The custom format string for a long date and long time value, which is associated with the "F" standard date and time format string.
Exceptions

ExceptionCondition
ArgumentNullException

An attempt was made to set the property to nullNothingnullptra null reference (Nothing in Visual Basic).

InvalidOperationException

The DateTimeFormatInfo object is read-only.

Remarks

See Custom Date and Time Format Strings for custom format specifiers that can be combined to construct custom format strings, such as "dddd, dd MMMM yyyy HH:mm:ss".

This property is affected if the value of the Calendar property changes.

Examples

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

Visual Basic
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.FullDateTimePattern) & vbCrLf
   End Sub 
End Class  
'This code produces the following output.  The question marks take the place of native script characters.
' CULTURE    PROPERTY VALUE
'  en-US     dddd, MMMM dd, yyyy h:mm:ss tt
'  ja-JP     yyyy'?'M'?'d'?' H:mm:ss
'  fr-FR     dddd d MMMM yyyy HH:mm:ss
'
C#
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.FullDateTimePattern) + "\n";
   }
}
/*
This example produces the following output.  The question marks take the place of native script characters.
    CULTURE    PROPERTY VALUE
     en-US     dddd, MMMM dd, yyyy h:mm:ss tt
     ja-JP     yyyy'?'M'?'d'?' H:mm:ss
     fr-FR     dddd d MMMM yyyy HH:mm:ss
*/
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Tags :


Page view tracker