Returns the day-of-year component of a Date.
Here are some examples:
date myDate = date.newInstance(1998, 10, 21); Integer day = myDate.dayOfYear(); system.debug(day);
Output: 294