Description
Given a string date in the format YYYY-MM-DD, return the day number of the year. For example, "2019-01-09" is the 9th day of the year.
Examples
Input:
date = "2019-01-09"Output:
9Explanation:
9th day of 2019.
Input:
date = "2019-02-10"Output:
41Explanation:
January has 31 days, so February 10 is day 31 + 10 = 41.
Input:
date = "2003-03-01"Output:
60Explanation:
January has 31 days and February 2003 (non-leap year) has 28 days, so March 1 is day 31 + 28 + 1 = 60.
Constraints
- •
date is valid Gregorian calendar date