timedelta_to_si_years

giant.catalogues.utilities:

giant.catalogues.utilities.timedelta_to_si_years(delta)[source]

This function converts a python timedelta object to a fractional number of SI years.

The timedelta object is first converted to seconds using method total_seconds, and this is then converted to SI years.

Parameters

delta (datetime.timedelta) – The python timedelta object to be converted to fractional SI years

Returns

The length of time covered by the time delta in units of fractional SI years

Return type

float