Java Calendar Year getIntYear(Calendar c)

Here you can find the source of getIntYear(Calendar c)

Description

get Int Year

License

Apache License

Declaration

public static Integer getIntYear(Calendar c) 

Method Source Code

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

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

public class Main {

    public static Integer getIntYear(Calendar c) {
        int year = c.get(Calendar.YEAR);
        return year;
    }/*from  w  ww . jav a 2  s. c  o  m*/

    public static Integer getIntYear(Date d) {
        if (d == null) {
            return null;
        }
        Calendar c = Calendar.getInstance();
        c.setTime(d);
        return getIntYear(c);
    }
}

Related

  1. calendarOf(int year, int month, int day, int hour, int minute, int second, int millis)
  2. copyYearMonthDay(Calendar destCal, Calendar sourceCal)
  3. createAndValidateCalendar(int month, int day, int year)
  4. getDecimalYear(Calendar calendar)
  5. getFiscalYear(Calendar calendar)
  6. getLastYear(Calendar cal)
  7. getStartOfWeekCalendar(final int year, final int weekOfYear, final Locale locale)
  8. getValidCalendar(int year, int month, int day)
  9. getWeekOfYear(Calendar currentDate)