Java Calendar Create getCalendar()

Here you can find the source of getCalendar()

Description

Returns a calendar instance.

License

Open Source License

Declaration

public static Calendar getCalendar() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

import java.util.Locale;
import java.util.TimeZone;

public class Main {
    /**//from   w  ww  .  j  a  va  2  s  . c o  m
     * Returns a calendar instance. If a context user is given then the user's
     * time zone and locale will be used if given.
     */
    public static Calendar getCalendar() {
        return getCalendar(null, null);
    }

    /**
     * Returns a calendar instance. If a context user is given then the user's
     * time zone and locale will be used if given.
     * 
     * @param locale if given this locale will overwrite any the context user's
     *            locale.
     */
    public static Calendar getCalendar(final Locale locale) {
        return getCalendar(null, locale);
    }

    public static Calendar getCalendar(TimeZone timeZone, Locale locale) {
        if (locale == null) {
            locale = Locale.getDefault();
        }
        if (timeZone == null) {
            timeZone = TimeZone.getDefault();
        }
        return Calendar.getInstance(timeZone, locale);
    }
}

Related

  1. createTimestampStr(Calendar para_calendar)
  2. getCalendar()
  3. getCalendar()
  4. getCalendar()
  5. getCalendar()
  6. getCalendar()
  7. getCalendar()
  8. getCalendar()
  9. getCalendar()