Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DateTimeFormatInfo.ShortTimePattern Property

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

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

public string ShortTimePattern { get; set; }

Property Value

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


An attempt was made to set the property to null.


The DateTimeFormatInfo object is read-only.

See Custom Date and Time Format Strings for custom date and time format specifiers that can be combined to construct custom format strings such as "HH:mm".

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 DateTimeFormatInfo.ShortTimePattern values do not change when the clock is set to 24 hours. The property values should become "h:mm" but remain "h:mm tt" where tt is AM or PM.

The following example displays the value of ShortTimePattern 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, "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.ShortTimePattern) + "\n";
This example produces the following output.
     en-US     h:mm tt
     ja-JP     H:mm
     fr-FR     HH:mm


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

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

Community Additions

© 2015 Microsoft