Skip to content

Commit e00a4d4

Browse files
author
Ron Petrusha
authored
Updated culture-sensitive formatting information (#2463)
* Updated culture-sensitive formatting information * Fixed bad link to include, broken xref * Corrected bad include
1 parent fbfb1e9 commit e00a4d4

File tree

2 files changed

+30
-33
lines changed

2 files changed

+30
-33
lines changed

includes/thread-formatting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
For more information about the current thread culture, see the <xref:System.Globalization.CultureInfo.CurrentCulture?displayProperty=nameWithType> and <xref:System.Threading.Thread.CurrentCulture%2A?displayProperty=nameWithType> properties. For more information about format characters, format patterns, and the output they produce, see [Standard date and time format strings](~/docs/standard/base-types/standard-date-and-time-format-strings.md) and [Custom date and time format strings](~/docs/standard/base-types/custom-date-and-time-format-strings.md). For more information about changing the format pattern associated with a format character, see the <xref:System.Globalization.DateTimeFormatInfo> class.

xml/System/DateTime.xml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7284,18 +7284,17 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri
72847284
## Remarks
72857285
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.LongDatePattern%2A> property associated with the current thread culture. The return value is identical to the value returned by specifying the "D" [standard DateTime format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
72867286

7287-
> [!IMPORTANT]
7288-
> The string returned by the <xref:System.DateTime.ToLongDateString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo> object. For example, for the en-US culture, the standard long date pattern is "dddd, MMMMdd, yyyy"; for the de-DE culture, it is "dddd, d. MMMMyyyy"; for the ja-JP culture, it is "yyyy'?'M'?'d'?'". The specific format string on a particular computer can also be customized so that it differs from the standard long date format string.
7289-
7290-
For more information about the current thread culture, see the <xref:System.Threading.Thread.CurrentCulture%2A> property. For more information about format characters, format patterns, and the output they produce, see the [Formatting Types](~/docs/standard/base-types/formatting-types.md) topic. For more information about changing the format pattern associated with a format character, see the <xref:System.Globalization.DateTimeFormatInfo> class.
7291-
7292-
7287+
> [!NOTE]
7288+
> The string returned by the <xref:System.DateTime.ToLongDateString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo.LongDatePattern?displayProperty=nameWithType> property. For example, for the en-US culture, the standard long date pattern is commonly "dddd, MMMM dd, yyyy"; for the de-DE culture, it is "dddd, d. MMMM yyyy"; for the ja-JP culture, it is "yyyy'年'M'月'd'日'". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization.
7289+
7290+
[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)]
72937291

7294-
## Examples
7295-
The following example demonstrates the <xref:System.DateTime.ToLongDateString%2A> method.
7292+
## Examples
7293+
7294+
The following example demonstrates the <xref:System.DateTime.ToLongDateString%2A> method.
72967295

7297-
[!code-csharp[DateTime.ToShortLongString#1](~/samples/snippets/csharp/VS_Snippets_CLR/DateTime.ToShortLongString/cs/sls.cs#1)]
7298-
[!code-vb[DateTime.ToShortLongString#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/DateTime.ToShortLongString/vb/sls.vb#1)]
7296+
[!code-csharp[DateTime.ToShortLongString#1](~/samples/snippets/csharp/VS_Snippets_CLR/DateTime.ToShortLongString/cs/sls.cs#1)]
7297+
[!code-vb[DateTime.ToShortLongString#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/DateTime.ToShortLongString/vb/sls.vb#1)]
72997298

73007299
]]></format>
73017300
</remarks>
@@ -7348,14 +7347,13 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri
73487347
<format type="text/markdown"><![CDATA[
73497348

73507349
## Remarks
7351-
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.LongTimePattern%2A?displayProperty=nameWithType> property associated with the current thread culture. The return value is identical to the value returned by specifying the "T" [standard date and time format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
7352-
7353-
> [!IMPORTANT]
7354-
> The string returned by the <xref:System.DateTime.ToLongTimeString%2A> method is culture-sensitive. It reflects the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.LongTimePattern%2A> property of the current culture's <xref:System.Globalization.DateTimeFormatInfo> object. For example, for the en-US culture, the standard long time pattern is "h:mm:ss tt"; for the de-DE culture, it is "HH:mm:ss"; for the ja-JP culture, it is "H:mm:ss". The specific format string on a particular computer can also be customized so that it differs from the standard long time format string.
7355-
7356-
For more information about the current thread culture, see the <xref:System.Threading.Thread.CurrentCulture%2A> property. For more information about format characters, format patterns, and the output they produce, see the [Formatting Types](~/docs/standard/base-types/formatting-types.md) topic. For more information about changing the format pattern associated with a format character, see the <xref:System.Globalization.DateTimeFormatInfo> class.
7350+
7351+
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.LongTimePattern%2A?displayProperty=nameWithType> property associated with the current thread culture. The return value is identical to the value returned by specifying the "T" [standard date and time format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
73577352

7358-
7353+
> [!NOTE]
7354+
> The string returned by the <xref:System.DateTime.ToLongTimeString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo.LongTimePattern%2A?displayProperty=nameWithType> property. For example, for the en-US culture, the standard long time pattern is "h:mm:ss tt"; for the de-DE culture, it is "HH:mm:ss"; for the ja-JP culture, it is "H:mm:ss". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization.
7355+
7356+
[!INCLUDE[culture-sensitive-formatting](~/includes/thread-formatting.md)]
73597357

73607358
## Examples
73617359
The following example demonstrates the <xref:System.DateTime.ToLongTimeString%2A> method.
@@ -7467,13 +7465,11 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri
74677465
## Remarks
74687466
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.ShortDatePattern%2A?displayProperty=nameWithType> property associated with the current thread culture. The return value is identical to the value returned by specifying the "d" [standard DateTime format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
74697467

7470-
> [!IMPORTANT]
7471-
> The string returned by the <xref:System.DateTime.ToShortDateString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo> object. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/M/d". The specific format string on a particular computer can also be customized so that it differs from the standard short date format string.
7472-
7473-
For more information about the current thread culture, see the <xref:System.Threading.Thread.CurrentCulture%2A?displayProperty=nameWithType> property. For more information about format characters, format patterns, and the output they produce, see the [Formatting Types](~/docs/standard/base-types/formatting-types.md) topic. For more information about changing the format pattern associated with a format character, see the <xref:System.Globalization.DateTimeFormatInfo> class.
7474-
7475-
7476-
7468+
> [!NOTE]
7469+
> The string returned by the <xref:System.DateTime.ToShortDateString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo.ShortDatePattern?displayProperty=nameWithType> property. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/MM/dd". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization.
7470+
7471+
[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)]
7472+
74777473
## Examples
74787474
The following example demonstrates the <xref:System.DateTime.ToShortDateString%2A> method. It also shows that the result of calling the <xref:System.DateTime.ToShortDateString%2A> method is identical to calling the <xref:System.DateTime.ToString%28System.String%29?displayProperty=nameWithType> method with "d" as the format parameter.
74797475

@@ -7530,16 +7526,15 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri
75307526
<remarks>
75317527
<format type="text/markdown"><![CDATA[
75327528

7533-
## Remarks
7534-
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.ShortTimePattern%2A?displayProperty=nameWithType> property associated with the current thread culture. The return value is identical to the value returned by specifying the "t" [standard DateTime format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
7535-
7536-
> [!IMPORTANT]
7537-
> The string returned by the <xref:System.DateTime.ToShortTimeString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo> object. For example, for the en-US culture, the standard short time pattern is "h:mm tt"; for the de-DE culture, it is "HH:mm"; for the ja-JP culture, it is "H:mm". The specific format string on a particular computer can also be customized so that it differs from the standard short time format string.
7538-
7539-
For more information about the current thread culture, see the <xref:System.Threading.Thread.CurrentCulture%2A> property. For more information about format characters, format patterns, and the output they produce, see the [Formatting Types](~/docs/standard/base-types/formatting-types.md) topic. For more information about changing the format pattern associated with a format character, see the <xref:System.Globalization.DateTimeFormatInfo> class.
7540-
7541-
7529+
## Remarks
7530+
7531+
The value of the current <xref:System.DateTime> object is formatted using the pattern defined by the <xref:System.Globalization.DateTimeFormatInfo.ShortTimePattern%2A?displayProperty=nameWithType> property associated with the current thread culture. The return value is identical to the value returned by specifying the "t" [standard DateTime format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) with the <xref:System.DateTime.ToString%28System.String%29> method.
75427532

7533+
> [!NOTE]
7534+
> The string returned by the <xref:System.DateTime.ToShortTimeString%2A> method is culture-sensitive. It reflects the pattern defined by the current culture's <xref:System.Globalization.DateTimeFormatInfo.ShortTimePattern?displayProperty=nameWithType> property. For example, for the en-US culture, the standard short time pattern is "h:mm tt"; for the de-DE culture, it is "HH:mm"; for the ja-JP culture, it is "H:mm". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization.
7535+
7536+
[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)]
7537+
75437538
## Examples
75447539
The following example demonstrates the <xref:System.DateTime.ToShortTimeString%2A> method.
75457540

0 commit comments

Comments
 (0)