EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

DateTimeFormatInfo.LongTimePattern Property

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

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

public string LongTimePattern { get; set; }

Property Value

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

ExceptionCondition
ArgumentNullException

An attempt was made to set the property to null.

InvalidOperationException

The DateTimeFormatInfo object is read-only.

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


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, "ar-EG");
      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.LongTimePattern) + "\n";
   }
}
/*
This example produces the following output.
//     CULTURE    PROPERTY VALUE
//      en-US     h:mm:ss tt
//      ar-EG     hh:mm:ss tt
//      fr-FR     HH:mm:ss
*/


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Mostrar:
© 2015 Microsoft