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