datetoyear#
- datetoyear(dateobj, dateformat=None)[source]#
Convert a DateTime instance to decimal year.
- Parameters:
- Returns:
Equivalent decimal year
Example:
sc.datetoyear('2010-07-01') # Returns approximately 2010.5
By Luke Davis from https://stackoverflow.com/a/42424261, adapted by Romesh Abeysuriya.
New in version 1.0.0.