Java Calendar Create getCalendar(TimeZone timeZone, Locale locale)

Here you can find the source of getCalendar(TimeZone timeZone, Locale locale)

Description

get Calendar

License

MIT License

Declaration

public static Calendar getCalendar(TimeZone timeZone, Locale locale) 

Method Source Code

//package com.java2s;
/*!// w  w w  .  jav a  2s  .c om
 * mifmi-commons4j
 * https://github.com/mifmi/mifmi-commons4j
 *
 * Copyright (c) 2015 mifmi.org and other contributors
 * Released under the MIT license
 * https://opensource.org/licenses/MIT
 */

import java.util.Calendar;

import java.util.Locale;

import java.util.TimeZone;

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

Related

  1. getCalendar(String dateString)
  2. getCalendar(String gdate)
  3. getCalendar(String str)
  4. getCalendar(String time, char sep, boolean isStart)
  5. getCalendar(String yyyy, String mm, String dd)
  6. getCalendarAtMidnight(Date d)
  7. getCalendarBefore(int i)
  8. getCalendarByName(String timeZone)
  9. getCalendarBySpecific(int year, int month, int date, int hour)