Re: date is not correct

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 08 2011 - 12:04:14 MST

Please read the documentation for:
   http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_week.shtml

The day numbering starts on Sunday.

Return value

A integer array of the same size as year with values between 0 and 6,
where 0=Sunday, 1=Monday, ..., 6=Saturday.
=====
Change
  days_abbr = (/"SAT","SUN","MON","TUE","WED","THR","FRI"/)
To
  days_abbr = (/"SUN","MON","TUE","WED","THR","FRI","SAT"/)

On 12/8/11 11:53 AM, ahmed lasheen wrote:
> hello
> i am trying to print the intial time for wam model grib file.
> the intial time was
> (0) 12/07/2011 (12:00)
> and when i used the following code to print it in formate of names of
> months and days of week
> it give me the following
> (0) 12Z TUE 07 Dec 2011
> and this is wrong as the 7 of December is Wednesday not Tuesday.
>
> *month_abbr =
> (/"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)
> days_abbr = (/"SAT","SUN","MON","TUE","WED","THR","FRI"/)
> ;;;;;;;;;;;;;;;;;Dealing with the intial time***
> stc_ini_time=stringtochar(ini_time);string to character(stc)
> ;print(stc_ini_time) ;print if you want
> ;;for further information about coverting form string to integers see
> the following
> ;http://www.ncl.ucar.edu/Support/talk_archives/2005/0483.html
> iyear=stringtointeger((/stc_ini_time(6:9)/))
> imonth=stringtointeger((/stc_ini_time(0:1)/))
> iday=stringtointeger((/stc_ini_time(3:4)/))
> iminute=stringtointeger((/stc_ini_time(15:16)/))
> ihour=stringtointeger((/stc_ini_time(12:13)/))
> ini_time_print =sprinti(" %0.2i",ihour)+"Z
> "+days_abbr(day_of_week(iyear,imonth,iday))+sprinti(" %0.2i
> ",iday)+month_abbr(imonth)+sprinti(" %0.4i ",iyear)*
>
> so what is going wrong with previous code .
> i have attached the script and the output .
> thanks in advance
>
> --
> ===============
> 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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 8 12:04:25 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 09 2011 - 13:09:09 MST