<div dir="ltr"><div><div><div><div>That is a clever solution. I never would never have thought of that!<br><br></div>However, my experience is that the *nix 'date' can be a bit finicky.<br><br></div>In my case, it works on two *nix systems but fails on my MAC ("date: illegal time format")<br><br></div>I am not sure why this should happen.<br><br></div>Attached is a quick and dirty NCL function and test that (may) be more robust<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 12:22 PM, <span dir="ltr"><<a href="mailto:jmason@eos.ubc.ca" target="_blank">jmason@eos.ubc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml</a><br>
<br>
This works for me<br>
<br>
Date = systemfunc("date '+%Y%m%d' --date '5 days'")<br>
<br>
Jesse<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> Dear ncl-team<br>
> I'm using the ncl 6.1.2 on imac Darwin 64bit<br>
> I need to calculate the resulting date in the form YYYYMMDD<br>
> (year,mounth and day)<br>
> starting from an initial date YYYYMMDD of string type and adding a<br>
> certain number of day<br>
> For example func("20140928" + 5 day) = "20141003"<br>
> Has ncl a routine that do this task?<br>
><br>
> thanks<br>
> Francesco Trotta<br>
> _______________________________________________<br>
> ncl-talk mailing list<br>
> List instructions, subscriber options, unsubscribe:<br>
> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
><br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</div></div></blockquote></div><br></div>