function  anytim2year,datetime

;  Convert date to decimal year

;  This is an attempt to get over the date restrictions in
;  SSW for very long time series (centuries). SSW time routines
;  are not happy outside of 1950-2049...
  
ex = anytim(datetime,/ex)

;  try to get the DOY right by doing modulo of a century
;  not quite right because of corrections... 
modex = ex
modex(6,*) = modex(6,*) mod 100
doy = anytim2doy(modex)

;  form decimal year
year = ex(6,*) + doy/365.25          ; not exact - needs fixing

return, year
end
