There are a lot of 'time/calendar' functions.
Please look at the documentation.
http://www.ncl.ucar.edu/Document/Functions/ [ See "Date" ]
tunits = "hours ref 1-1-1 00:00:0.0" ; use whatever you want
hard wired
tStrt = ut_inv_calendar(2010,1,12,12,0,0,time@units, 0)
use variables
tStrt = ut_inv_calendar(year,month,day,hour,minute,second,units, 0)
print(tStrt)
tstep = 12
ntim = 100
time = tStrt + ispan(0,tstep*(ntim-1),12)
Then you can use
ymdh = ut_inv_calendar(time, 0) ; what ever option you want
http://www.ncl.ucar.edu/Document/Functions/Built-in/ut_inv_calendar.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/ut_calendar.shtml
On 1/12/11 1:29 PM, ahmed lasheen wrote:
> Hello
> I wanna to know how can i add hours to certain date.
> for example , i have these variables year=2010, month=01 ,day=12 and
> hour=12:00 and i wanna to make loop which each iteration add 06:00 hours
> to this date.
> thanks in advance
>
> --
> ===============
> Ahmed Lasheen
> Egyptian Meteorological Authority(EMA)
> Cairo,Egypt
> ===============
>
>
>
> _______________________________________________
> 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-talk
Received on Wed Jan 12 15:22:25 2011
This archive was generated by hypermail 2.1.8 : Thu Jan 13 2011 - 09:24:20 MST