Day of the Year
Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
date.length == 10date[4] == date[7] == '-', and all otherdate[i]'s are digitsdaterepresents a calendar date between Jan 1st, 1900 and Dec 31, 2019.
Last updated
Was this helpful?