From a019f58526e3f2bcae2e93642924a8e5fd7874b6 Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Fri, 17 May 2019 10:32:45 -0700 Subject: [PATCH 1/3] Updated culture-sensitive formatting information --- includes/thread-formatting.md | 2 ++ xml/System/DateTime.xml | 61 ++++++++++++++++------------------- 2 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 includes/thread-formatting.md diff --git a/includes/thread-formatting.md b/includes/thread-formatting.md new file mode 100644 index 00000000000..decbd64d89b --- /dev/null +++ b/includes/thread-formatting.md @@ -0,0 +1,2 @@ + +For more information about the current thread culture, see the and 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 class. diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index e8354e9d611..855afc62e9e 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -7284,18 +7284,17 @@ The following example demonstrates the object is formatted using the pattern defined by the 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 method. -> [!IMPORTANT] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. - - For more information about the current thread culture, see the 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 class. - - +> [!NOTE] +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. + +[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] -## Examples - The following example demonstrates the method. +## Examples + +The following example demonstrates the method. - [!code-csharp[DateTime.ToShortLongString#1](~/samples/snippets/csharp/VS_Snippets_CLR/DateTime.ToShortLongString/cs/sls.cs#1)] - [!code-vb[DateTime.ToShortLongString#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/DateTime.ToShortLongString/vb/sls.vb#1)] +[!code-csharp[DateTime.ToShortLongString#1](~/samples/snippets/csharp/VS_Snippets_CLR/DateTime.ToShortLongString/cs/sls.cs#1)] +[!code-vb[DateTime.ToShortLongString#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/DateTime.ToShortLongString/vb/sls.vb#1)] ]]> @@ -7348,14 +7347,13 @@ The following example demonstrates the object is formatted using the pattern defined by the 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 method. - -> [!IMPORTANT] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the property of the current culture's 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. - - For more information about the current thread culture, see the 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 class. + +The value of the current object is formatted using the pattern defined by the 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 method. - +> [!NOTE] +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. + +[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] ## Examples The following example demonstrates the method. @@ -7467,13 +7465,11 @@ The following example demonstrates the object is formatted using the pattern defined by the 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 method. -> [!IMPORTANT] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. - - For more information about the current thread culture, see the 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 class. - - - +> [!NOTE] +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's method. 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. + +[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] + ## Examples The following example demonstrates the method. It also shows that the result of calling the method is identical to calling the method with "d" as the format parameter. @@ -7530,16 +7526,15 @@ The following example demonstrates the object is formatted using the pattern defined by the 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 method. - -> [!IMPORTANT] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. - - For more information about the current thread culture, see the 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 class. - - +## Remarks + +The value of the current object is formatted using the pattern defined by the 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 method. +> [!NOTE] +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. + +[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] + ## Examples The following example demonstrates the method. From bf8d54d66317448886899f3d140e36d7815f3819 Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Mon, 20 May 2019 09:18:53 -0700 Subject: [PATCH 2/3] Fixed bad link to include, broken xref --- xml/System/DateTime.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 855afc62e9e..584e117c494 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -7466,9 +7466,9 @@ The value of the current object is formatted using the pa The value of the current object is formatted using the pattern defined by the 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 method. > [!NOTE] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's method. 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. +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. -[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] +[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] ## Examples The following example demonstrates the method. It also shows that the result of calling the method is identical to calling the method with "d" as the format parameter. @@ -7533,7 +7533,7 @@ The value of the current object is formatted using the pa > [!NOTE] > The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. -[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] +[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] ## Examples The following example demonstrates the method. From e92074fe54c3131a64be91f626f7aeea4fabab4b Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Tue, 21 May 2019 08:37:15 -0700 Subject: [PATCH 3/3] Corrected bad include --- xml/System/DateTime.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 584e117c494..1a29dbbef39 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -7353,7 +7353,7 @@ The value of the current object is formatted using the pa > [!NOTE] > The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's 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. -[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] +[!INCLUDE[culture-sensitive-formatting](~/includes/thread-formatting.md)] ## Examples The following example demonstrates the method.