Repository navigation
Support culture-independent seconds matching in millisecond date formatting (Fixes #40356) - #56664
Open
Manish-1kumar wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The VB and C# regexes mishandle escaped characters and quoted literals, causing milliseconds to be omitted, duplicated, or inserted into literal text.
2 open issues
What changed in this PR
This PR addresses #40356 by updating the .NET documentation samples to insert milliseconds without requiring colon-based time separators.
Changes:
- Replaces colon-dependent seconds matching in the C# and Visual Basic samples.
- Quotes the culture-specific decimal separator in the date/time format.
- Updates the article’s explanation and date metadata.
| File | Description |
|---|---|
docs/standard/base-types/snippets/how-to-display-milliseconds-in-date-and-time-values/vb/Program.vb |
Updates seconds matching and decimal-separator quoting in Visual Basic. |
docs/standard/base-types/snippets/how-to-display-milliseconds-in-date-and-time-values/csharp/Program.cs |
Updates seconds matching and decimal-separator quoting in C#. |
docs/standard/base-types/how-to-display-milliseconds-in-date-and-time-values.md |
Explains culture-independent seconds matching and refreshes the article date. |
Review effort: Balanced
Manish-1kumar
force-pushed
the
users/manish/issue-40356-milliseconds-full-datetime-pattern
branch
from
November 30, 2026 17:40
3a84f62 to
b488075
Compare
…ips quoted and escaped literals
Member
|
@tarekgh PTAL. Would you prefer a RegEx based example that handles all cultures? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Fixes #40356
Summary of Changes
Internal previews
Build report