Java Calendar Create createCalendarWith()

Here you can find the source of createCalendarWith()

Description

create Calendar With

License

Apache License

Declaration

public static Calendar createCalendarWith() 

Method Source Code


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

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

public class Main {
    private final static TimeZone tz = TimeZone.getTimeZone("Europe/Vienna");

    public static Calendar createCalendarWith() {
        final Calendar cal = Calendar.getInstance(tz);
        return cal;
    }/*from w  w  w  . j a  v  a  2s  .  c  o  m*/

    public static Calendar createCalendarWith(int y, int mo, int d, int h, int min, int s) {
        final Calendar cal = Calendar.getInstance(tz);
        cal.set(Calendar.YEAR, y);
        cal.set(Calendar.MONTH, mo);
        cal.set(Calendar.DAY_OF_MONTH, d);
        cal.set(Calendar.HOUR_OF_DAY, h);
        cal.set(Calendar.MINUTE, min);
        cal.set(Calendar.SECOND, s);
        cal.set(Calendar.MILLISECOND, 0);
        return cal;
    }
}

Related

  1. createCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second)
  2. createCalendar(long timeInMillis)
  3. createCalendarFromParts(String[] parts)
  4. createCalendarInstance(final Locale locale)
  5. createCalendarMidnight(final Date date)
  6. createDateFormatString(Calendar cal)
  7. createDateStr(Calendar calendar)
  8. createIsoCalendar()
  9. createResetCalendar()