Convert current time to day (or seconds) of the year?

Hi, does anyone know a formula that can convert the current time/day to the day of the year or seconds?

like 30th May sld be the 150th day of 2007 etc…

tks