C#日付/時刻DateTime.IsLeapYear
DateTime.DaysInMonth

DateTime.IsLeapYear日付/時刻

TimeSpan.FromDays

うるう年かどうかを確認します。

문법

DateTime.IsLeapYear(year)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

Console
WriteLine
IsLeapYear
Console.WriteLine(DateTime.IsLeapYear(2024));   // True
Console.WriteLine(DateTime.IsLeapYear(2023));   // False