-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Updated culture-sensitive formatting information #2463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7284,18 +7284,17 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri | |
## Remarks | ||
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. | ||
|
||
> [!IMPORTANT] | ||
> 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. | ||
|
||
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. | ||
|
||
|
||
> [!NOTE] | ||
> 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. | ||
|
||
[!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] | ||
|
||
## Examples | ||
The following example demonstrates the <xref:System.DateTime.ToLongDateString%2A> method. | ||
## Examples | ||
|
||
The following example demonstrates the <xref:System.DateTime.ToLongDateString%2A> 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)] | ||
|
||
]]></format> | ||
</remarks> | ||
|
@@ -7348,14 +7347,13 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri | |
<format type="text/markdown">< with the <xref:System.DateTime.ToString%28System.String%29> method. | ||
|
||
> [!IMPORTANT] | ||
> 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. | ||
|
||
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. | ||
|
||
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. | ||
|
||
|
||
> [!NOTE] | ||
> 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. | ||
|
||
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] | ||
|
||
## Examples | ||
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 | |
## Remarks | ||
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. | ||
|
||
> [!IMPORTANT] | ||
> 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. | ||
|
||
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. | ||
|
||
|
||
|
||
> [!NOTE] | ||
> 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.ToShortDateString?displayProperty=nameWithType> 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 <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. | ||
|
||
|
@@ -7530,16 +7526,15 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri | |
<remarks> | ||
<format type="text/markdown">< with the <xref:System.DateTime.ToString%28System.String%29> method. | ||
|
||
> [!IMPORTANT] | ||
> 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. | ||
|
||
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. | ||
|
||
|
||
## Remarks | ||
|
||
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. | ||
|
||
> [!NOTE] | ||
> 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. | ||
|
||
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
|
||
## Examples | ||
The following example demonstrates the <xref:System.DateTime.ToShortTimeString%2A> method. | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this is a different include than the one you added above. I think that is what you meant, but I wanted to point it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, @BillWagner! This is a copy-and-paste error; I'd in fact meant to link to the new include file that I added in this PR.