write DAY_OF_YEAR

Hi,
How can I get and write out the current day of the year (0-365). The same as in php

$dayofyear = date("z");

Thanks

edit:
Nevermind, I found it.

http://community.screen-scraper.com/node/1108