Skip to content

Convert DateTime to ISO 8601 String in C#: update to .NET 11 - #2431

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/63713-convert-datetime-to-iso-8601-string-csharp
Open

vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/63713-convert-datetime-to-iso-8601-string-csharp

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the ConvertDateTimeToIso8601String sample to net11.0 with current test packages and removes ReflectionMagic, so the tests no longer write a private TimeZoneInfo field and build their expected local strings from the machine's own offset. Week dates now come from ISOWeek, which fixes the week number, the week-numbering year at New Year and Sunday as day 7. Every custom format passes the invariant culture, the custom format list drops the en dash rows and corrects the fraction and offset rows, and new tests cover DateTimeOffset round trips, the literal Z on UTC values, culture-dependent output under fi-FI and th-TH, and week dates at the turn of the year (23 cases).

Target net11.0, update test packages, drop ReflectionMagic, build ISO week dates with ISOWeek, pass the invariant culture to every custom format, correct the custom format list and add tests for DateTimeOffset, the literal Z, culture-dependent output and week dates at the turn of the year.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant