Java Year Get getCurrentYear()

Here you can find the source of getCurrentYear()

Description

get Current Year

License

Apache License

Declaration

public static int getCurrentYear() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static int getCurrentYear() {
        return getYear(new Date());
    }//from w ww .ja v  a 2s  . c  om

    public static int getYear(Date date) {
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        return calendar.get(Calendar.YEAR);
    }
}

Related

  1. currentYear()
  2. currentYearStr()
  3. getBeforeYear()
  4. getBeginningOfYear()
  5. getCalendarYearString(Calendar date)
  6. getCurrentYearAsInt()
  7. getCurrYearFirst()
  8. getDateOneYearFromNow()
  9. getDaysFromYearZero(Calendar date)