Skip to content

Support culture-independent seconds matching in millisecond date formatting (Fixes #40356) - #56664

Open
Manish-1kumar wants to merge 1 commit into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-40356-milliseconds-full-datetime-pattern
Open

Manish-1kumar wants to merge 1 commit into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-40356-milliseconds-full-datetime-pattern

Conversation

@Manish-1kumar

Copy link
Copy Markdown
Contributor

Fixes #40356

Summary of Changes

  • Replaces culture-inflexible colon-dependent regex (:ss|:s)\ in C# and Visual Basic snippets with a culture-independent regex matching unquoted seconds specifiers \s\ or \ss\ outside literal quotation marks.
  • Fixes formatting in cultures where \FullDateTimePattern\ does not use colons as time separators (such as \da-DK, \ i-FI, \ r-CA, \�s-IN, \id-ID, etc.).
  • Encloses the culture's decimal separator in single quotes ('{NumberDecimalSeparator}'fff) to prevent special format token misinterpretation when passed to \ToString().
  • Updates \docs/standard/base-types/how-to-display-milliseconds-in-date-and-time-values.md\ with updated explanation and verified build.

@dotnetrepoman dotnetrepoman Bot added this to the November 2026 milestone Nov 1, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"(:ss|:s)" regex in the milliseconds example does not match FullDateTimePattern in all cultures

1 participant