day_of_year

sunpy.time.day_of_year(time_string)[source] [edit on github]

Returns the (fractional) day of year.

Parameters:time_string (string) – A parse_time compatible string
Returns:out (float) – The fractional day of year (where Jan 1st is 1).

Examples

>>> import sunpy.time
>>> sunpy.time.day_of_year('2012/01/01')
1.0
>>> sunpy.time.day_of_year('2012/08/01')
214.0
>>> sunpy.time.day_of_year('2005-08-04T00:18:02.000Z')
216.01252314814815