[ncl-talk] convert yyyymmdd to string

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Mon Apr 4 11:59:35 MDT 2016


Chang,

No, there is no such fuction in the current NCL function library.  You
could do this by parsing yyyymmdd into 3 integer parts, then call
cd_inv_calendar, followed by cd_string.

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

However, that is more complicated than necessary, and there are side
issues.  I recommend writing your own function; it should be quite easy.
You will still need to parse yyyymmdd into 3 parts.  Use sprinti ("%2.2i",
dd) to make the day number into a 2-digit string.

--Dave


On Mon, Apr 4, 2016 at 10:38 AM, Xi Chang <xi.chang01 at gmail.com> wrote:

> Hi NCL,
>
> is there any a function that is able to convert the calender date with
> format
> yyyymmdd to dd-month-yyyy? where month is e.g., Jan, Feb etc.
>
> Thank you
>
> Chang..
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160404/bc944111/attachment.html 


More information about the ncl-talk mailing list