Here you can find the source of getDayOfThisYear(Date currentdate)
public static int getDayOfThisYear(Date currentdate)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getDayOfThisYear(Date currentdate) { Calendar cal = Calendar.getInstance(); if (currentdate != null) { cal.setTime(currentdate);/*from w w w .j ava 2 s . c o m*/ } else { cal.setTime(new Date()); } return cal.get(Calendar.DATE); } }