[ncl-talk] manipulate date

Dennis Shea shea at ucar.edu
Fri Sep 26 15:49:29 MDT 2014


That is a clever solution. I never would never have thought of that!

However, my experience is that the *nix 'date' can be a bit finicky.

In my case, it works on two *nix systems but fails on my MAC ("date:
illegal time format")

I am not sure why this should happen.

Attached is a quick and dirty NCL  function and test that (may) be more
robust

On Fri, Sep 26, 2014 at 12:22 PM, <jmason at eos.ubc.ca> wrote:

> https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml
>
> This works for me
>
> Date = systemfunc("date '+%Y%m%d' --date '5 days'")
>
> Jesse
>
>
> > Dear ncl-team
> >     I'm using the ncl 6.1.2 on imac Darwin 64bit
> >     I need to calculate the resulting date in the form YYYYMMDD
> > (year,mounth and day)
> >     starting from an initial date YYYYMMDD of string type and adding a
> > certain number of day
> >     For example func("20140928" + 5 day) = "20141003"
> >     Has ncl a routine that do this task?
> >
> >     thanks
> > Francesco Trotta
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140926/081b351c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: date_plus_nday.ncl
Type: application/octet-stream
Size: 1214 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140926/081b351c/attachment.obj 


More information about the ncl-talk mailing list