Java Date to Year getYear(java.util.Date date)

Here you can find the source of getYear(java.util.Date date)

Description

get Year

License

Open Source License

Declaration

public static int getYear(java.util.Date date) 

Method Source Code

//package com.java2s;

public class Main {

    public static int getYear(java.util.Date date) {
        java.util.Calendar c = java.util.Calendar.getInstance();

        c.setTime(date);//from w  ww.  ja  v  a 2 s  . c o  m

        return c.get(java.util.Calendar.YEAR);

    }
}

Related

  1. getYear(Date dateParam)
  2. getYear(Date start)
  3. getYear(final Date date)
  4. getYear(final Date date)
  5. getYear(final Date date)
  6. getYear(java.util.Date today)
  7. getYear(String sdate)
  8. getYear(String strDate)
  9. getYearAsInt(Date aDate)