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..1a29dbbef39 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[culture-sensitive-formatting](~/includes/thread-formatting.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 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[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. @@ -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[culture-sensitive formatting](~/includes/thread-formatting.md)] + ## Examples The following example demonstrates the method.