code: public static int getDayOfYear(Date date) {
          Calendar c = Calendar.getInstance();
          c.setTime(date);
          return c.get(Calendar.DAY_OF_YEAR);
      }
docs: Get the day of year of the date
  
  @param date date
  @return day of year of the date