year = toint(time)/10000
print(year)
also ...
yyyymmdd = toint(time)
yyyymm = toint(time)/100
-- I am not sure if the units "day as %Y%m%d.%f" is recognized by udunits ( http://www.unidata.ucar.edu/software/udunits/ ) On 12/13/12 4:03 AM, Ronny Berndt wrote: > Hi, > > i have a netcdf file with a date/time field > > Variable: time (coordinate) > Type: double > Total Size: 328 bytes > 41 values > Number of Dimensions: 1 > Dimensions and sizes: [time | 41] > Coordinates: > Number Of Attributes: 3 > standard_name : time > units : day as %Y%m%d.%f > calendar : proleptic_gregorian > (0) 19601231.99930555 > (1) 19611231.99930555 > (2) 19621231.99930555 > > and .99930555 means 23:59:00 > > I want to convert this only into years. > How can i extract the year (maybe with substring or with date conversion functions)? > > Cheers, > Ronny > > > _______________________________________________ > ncl-talk mailing list > List instructions, subscriber options, unsubscribe: > http://mailman.ucar.edu/mailman/listinfo/ncl-talk > _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Thu Dec 13 06:48:48 2012
This archive was generated by hypermail 2.1.8 : Fri Dec 21 2012 - 10:43:23 MST