code: def dt2decyear(dt):
      
      year = dt.year
      startOfThisYear = datetime(year=year, month=1, day=1)
      startOfNextYear = datetime(year=year+1, month=1, day=1)
      yearElapsed = sinceEpoch(dt) - sinceEpoch(startOfThisYear)
      yearDuration = sinceEpoch(startOfNextYear) - sinceEpoch(startOfThisYear)
      fraction = yearElapsed/yearDuration
      return year + fraction
docs: Convert datetime to decimal year