Java Calendar Year setDate(Calendar cal, int year, int month, int day)

Here you can find the source of setDate(Calendar cal, int year, int month, int day)

Description

set Date

License

Open Source License

Declaration

private static void setDate(Calendar cal, int year, int month, int day) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 Open Software Solutions GmbH.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-3.0.html
 * /*from   w w  w  . ja va2s. com*/
 * Contributors:
 *     Open Software Solutions GmbH
 ******************************************************************************/

import java.util.Calendar;

public class Main {
    private static void setDate(Calendar cal, int year, int month, int day) {
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, month - 1);
        cal.set(Calendar.DATE, day);
    }
}

Related

  1. isToThisDayOrLater(int year, int month, int day, java.util.Calendar start, java.util.Calendar end)
  2. isWithinYears(int year, java.util.Calendar start, java.util.Calendar end)
  3. parseCalendar(int year, int month, double day, TimeZone zone)
  4. sameYear(Calendar one, Calendar two)
  5. setCalendarFields(Calendar cal, int year, int month, int day, int hour, int minute, int second, int millis)
  6. toCalendar(int year, int month, int day, int hour, int minutes, int seconds)
  7. toStringYearMonth(Calendar calendar)
  8. truncCalendarToHalfYear(Calendar c)
  9. truncCalendarToYear(Calendar c)