Re: printing the weeks day names

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 20 2011 - 15:21:41 MST

NCL has many useful date functions. Day of week is one of them.
There is a category page for date and calendar functions:

   http://www.ncl.ucar.edu/Document/Functions/date.shtml

You should be able to get the integer day of week, then use that to
subscript your array "days_abbr".

--Dave

On 1/20/2011 3:08 PM, ahmed lasheen wrote:
> Hello
> is there is a way to print the name of day week(saturday ,sunday
> ,...) instead of the number .
> the following code print the date in the formate00Z 01 Jan 2011 , i
> wish i could print it as
> 00Z Sat 01 Jan 2011.,
> ------
> month_abbr =
> (/"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", \
> "Oct","Nov","Dec"/)
> days_abbr = (/"sat","sun","mon","tue","wed","thur","fir"/)
>
> time = (/00, 06, 12, 18, 24/)
> time@units = "hours since 2012-1-1 00:00:0.0"
>
> utc_date = ut_calendar(time, 0)
> year = floattointeger(utc_date(:,0))
> month = floattointeger(utc_date(:,1))
> day = floattointeger(utc_date(:,2))
> hour = floattointeger(utc_date(:,3))
> minute = floattointeger(utc_date(:,4))
> second = utc_date(:,5)
>
> my_date =sprinti("%0.2iZ ",hour)+sprinti("%0.2i
> ",day)+month_abbr(month)+sprinti(" %0.4i ",year)
> print(my_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 Thu Jan 20 15:21:48 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST