Re: printing the weeks day names

From: ahmed lasheen <ahmed4kernel_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 20 2011 - 16:27:17 MST

thanks
yes this function solve my problem , it return integers from 0-6 which i can
map it
directly to the week days names(sat,sun,..)
thanks

On Fri, Jan 21, 2011 at 1:16 AM, Dennis Shea <shea@ucar.edu> wrote:

> Please look at the date functions:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_week.shtml
>
>
> On 1/20/11 4:06 PM, ahmed lasheen wrote:
>
>> thanks
>> how can i map the integers (which represent the number of the days in
>> month which may be 29 or 30 or 31 day) to the seven days .how can i
>> know which number of day is saturday for example, have i to use external
>> shell command or there is some methode in ncl to do it.
>> u
>> On Fri, Jan 21, 2011 at 12:21 AM, Dave Allured <dave.allured@noaa.gov
>> <mailto:dave.allured@noaa.gov>> wrote:
>>
>> 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
>>
>>
>>
>>
>> --
>> ===============
>> 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
>>
>

-- 
===============
Ahmed Lasheen
Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
Egyptian Meteorological Authority(EMA)
Cairo,Egypt
===============

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 20 16:28:08 2011

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