Skip to content

Update CheckNumberOfDaysBetweenTwoDates to .NET 11 with DateOnly and DST examples - #2391

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/104050-csharp-calculate-the-number-of-days-between-two-dates
Nov 14, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/104050-csharp-calculate-the-number-of-days-between-two-dates

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves both projects of the days-between-two-dates sample to net11.0 with xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.12.0 and coverlet.collector 10.1.0, pins the current date in Program.cs so the printed output repeats, builds the New York event offset from TimeZoneInfo (UTC-4 on September 1, 2024, fixing the hand-typed -05:00 in the program and in one test row), adds a CalculateDaysBetweenDates method for DateOnly based on DayNumber, adds the time-of-day and daylight saving examples to Program.cs, and adds test rows for those cases with invariant-culture parsing.

@vladimir-pecanac-main
vladimir-pecanac-main merged commit 373e906 into CodeMazeBlog:main Nov 14, 2026
4 checks passed
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