Java Date to Year getYear(Date date)

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

Description

get Year

License

Open Source License

Declaration

public static int getYear(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static final int YEAR = 7;

    public static int getYear(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);//from w  ww .j av  a2s.co  m
        return c.get(Calendar.YEAR);
    }
}

Related

  1. getYear(Date date)
  2. getYear(Date date)
  3. getYear(Date date)
  4. getYear(Date date)
  5. getYear(Date date)
  6. getYear(Date date)
  7. getYear(Date date)
  8. getYear(Date date)
  9. getYear(Date date)