Java Calendar Create createCalendar(final int year, final int month, final int dayOfMonth, final TimeZone timeZone)

Here you can find the source of createCalendar(final int year, final int month, final int dayOfMonth, final TimeZone timeZone)

Description

create Calendar

License

Open Source License

Declaration

public static Calendar createCalendar(final int year, final int month, final int dayOfMonth,
            final TimeZone timeZone) 

Method Source Code

//package com.java2s;
// ProjectForge is dual-licensed.

import java.util.Calendar;
import java.util.TimeZone;

public class Main {
    public static Calendar createCalendar(final int year, final int month, final int dayOfMonth,
            final TimeZone timeZone) {
        return createCalendar(year, month, dayOfMonth, 0, 0, timeZone);
    }//from ww  w .java  2  s  . c o  m

    public static Calendar createCalendar(final int year, final int month, final int dayOfMonth,
            final int hourOfDay, final int minute, final TimeZone timeZone) {
        return createCalendar(year, month, dayOfMonth, hourOfDay, minute, 0, timeZone);
    }

    public static Calendar createCalendar(final int year, final int month, final int dayOfMonth,
            final int hourOfDay, final int minute, final int second, final TimeZone timeZone) {
        return createCalendar(year, month, dayOfMonth, hourOfDay, minute, second, 0, timeZone);
    }

    public static Calendar createCalendar(final int year, final int month, final int dayOfMonth,
            final int hourOfDay, final int minute, final int second, final int millisecond,
            final TimeZone timeZone) {
        final Calendar cal = Calendar.getInstance(timeZone);
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, month);
        cal.set(Calendar.DAY_OF_MONTH, dayOfMonth);
        cal.set(Calendar.HOUR_OF_DAY, hourOfDay);
        cal.set(Calendar.MINUTE, minute);
        cal.set(Calendar.SECOND, second);
        cal.set(Calendar.MILLISECOND, millisecond);
        return cal;
    }
}

Related

  1. createCalendar()
  2. createCalendar()
  3. createCalendar(Date date)
  4. createCalendar(final int year, final int month, final int day)
  5. createCalendar(final int year, final int month, final int day, final int hour, final int minute, final int second)
  6. createCalendar(int year, int month, int date)
  7. createCalendar(int year, int month, int day)
  8. createCalendar(int year, int month, int day, int hour, int minute, int second, boolean ceiling)
  9. createCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second)