How to get the total number of days in a year from the given date

后端 未结 5 1040
别跟我提以往
别跟我提以往 2021-01-05 00:24

I would like to get the total number of days in a year left from the given date .. Assume if a user gives 04-01-2011(MM-DD-YYYY) I would like to find the remain

5条回答
  •  长发绾君心
    2021-01-05 00:38

    Perhaps just:

    DateTime.IsLeapYear(DateTime.Now.Year) ? 366 : 365

    Sorry, read it as if you just wanted the number of days in current year...

提交回复
热议问题