Java Calendar Create getCalendarFormYear(int year)

Here you can find the source of getCalendarFormYear(int year)

Description

get Calendar of given year

License

Open Source License

Parameter

Parameter Description
year a parameter

Declaration

private static Calendar getCalendarFormYear(int year) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    /**//from w w  w  . ja v  a  2 s  .  co m
     * get Calendar of given year
     * 
     * @param year
     * @return
     */
    private static Calendar getCalendarFormYear(int year) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        cal.set(Calendar.YEAR, year);
        return cal;
    }
}

Related

  1. getCalendarDateFromToday(final int numDays)
  2. getCalendarDayString(Calendar date)
  3. getCalendarField(char c)
  4. getCalendarField(Date date, int calFieldId)
  5. getCalendarFieldName(int field)
  6. getCalendarForNextRun( GregorianCalendar startTime, int targetDay, int targetHour)
  7. getCalendarForSchedule(Calendar cal)
  8. getCalendarForTime(final long timeInMilliseconds)
  9. getCalendarFromDates(Date date, Date hourMinuteMillisseconds)