<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>You can use "day_of_year", but you need to split the value into separate year, month, and day integers.</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml</a></div><div><br></div><div>Here's some sample code:</div><div><br></div><font class="Apple-style-span" face="Courier">d = 20120305 &nbsp; &nbsp;; assuming "d" is an int or a long<br><br>year &nbsp;= toint(d/10000)<br>month = toint((d-(year*10000))/100)<br>day &nbsp; = toint(d-(year*10000)-(month*100))<br><br>print("year &nbsp;= " + year)<br>print("month = " + month)<br>print("day &nbsp; = " + day)<br><br>doy = day_of_year(year,month,day)<br><br>print("doy = " + doy)</font><br><br><div><div><br></div><div>If YYYYMMDD is a string, then convert it to an integer first using "toint".</div><div><br></div><div>--Mary</div><div><br></div><div>On Oct 10, 2012, at 10:40 AM, virginie hergault wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi users,<br><br>I would like to know how to convert a date YYYYMMDD to the day of the<br>year (between 1 and 365) ?<br>Is there a function available in ncl for this?<br><br>Thank you,<br>Virginie<br>_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br></body></html>