...
Code Block | ||
---|---|---|
| ||
# obtain two lists - one of dates and one of times d = grib_get_long(fs, 'validityDate') t = grib_get_long(fs, 'validityTime') # times are in hours, like 1200 is 12:00, so we have to divide by 100 # to get them into hours, then by 24 to get them into fractions of days dates = d + (t / 2400 ) # ASSUME the times are in hours, like 1200 is 12:00 print(dates) # but these are still numbers - we need to allcall the date() function to convert # into proper date variables, and we need to loop through the list to do it date_list = nil loop dt in dates date_list = date_list & [date(dt)] end loop print(date_list) |
...