Returns an equivalent instance of {@link java.util.Calendar}.
The time portion of the returned calendar is cleared and the time zone is the current system default.

@param self a LocalDate
@return a java.util.Calendar
@since 2.5.0
967296
public static Calendar toCalendar(final LocalDate self) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DATE, self.getDayOfMonth());
        cal.set(Calendar.MONTH, self.getMonthValue() - 1);
        cal.set(Calendar.YEAR, self.getYear());
        clearTimeCommon(cal);
        return cal;
    }
806671
static final public DateFormat getInstance(Calendar cal) {
        return getInstance(cal, ULocale.getDefault(Category.FORMAT));
    }
987367
def _getFromTime(self, atDate=None):
        
        if atDate is None:
            atDate = timezone.localdate(timezone=self.tz)
        return getLocalTime(atDate, self.time_from, self.tz)
330955
@Override  // for covariant return type
    @SuppressWarnings("unchecked")
    public ChronoLocalDateTime<JulianDate> atTime(LocalTime localTime) {
        return (ChronoLocalDateTime<JulianDate>) super.atTime(localTime);
    }
737800
@Override
    @SuppressWarnings("unchecked")
    public final ChronoLocalDateTime<HijrahDate> atTime(LocalTime localTime) {
        return (ChronoLocalDateTime<HijrahDate>) super.atTime(localTime);
    }
585587
public static LocalDateTime firstDay(String localDate) {
        LocalDateTime parse = parse(localDate, DEFAULT_PATTERN);
        return LocalDateTime.of(parse.getYear(), parse.getMonth(), 1, 0, 0, 0);
    }
401387
public LocalDate toDomain(Date from) {
        if (from == null) {
            return null;
        }
        return new LocalDate(from.getTime());
    }
832081
public static final <T extends Calendar> Function<T, LocalTime> calendarToLocalTime(DateTimeZone dateTimeZone) {
		return new CalendarToLocalTime<T>(dateTimeZone);
	}
368974
public Calendar toCalendar(TimeZone zone, Locale locale) {
		if (null == locale) {
			locale = Locale.getDefault(Locale.Category.FORMAT);
		}
		final Calendar cal = (null != zone) ? Calendar.getInstance(zone, locale) : Calendar.getInstance(locale);
		cal.setFirstDayOfWeek(firstDayOfWeek.getValue());
		cal.setTime(this);
		return cal;
	}
1297928
protected Calendar getLocalTimeAsCalendar(BigDecimal localTimeParam, Calendar date) {
        if (localTimeParam == null) {
            return null;
        }

        // Create a clone of the input calendar so we get locale/timezone information.
        Calendar resultTime = (Calendar) date.clone();

        BigDecimal localTime = localTimeParam;
        if (localTime.compareTo(BigDecimal.ZERO) == -1) {
            localTime = localTime.add(BigDecimal.valueOf(24.0D));
            resultTime.add(Calendar.HOUR_OF_DAY, -24);
        }
        String[] timeComponents = localTime.toPlainString().split("\\.");
        int hour = Integer.parseInt(timeComponents[0]);

        BigDecimal minutes = new BigDecimal("0." + timeComponents[1]);
        minutes = minutes.multiply(BigDecimal.valueOf(60)).setScale(0, RoundingMode.HALF_EVEN);
        if (minutes.intValue() == 60) {
            minutes = BigDecimal.ZERO;
            hour += 1;
        }
        if (hour == 24) {
            hour = 0;
        }

        // Set the local time
        resultTime.set(Calendar.HOUR_OF_DAY, hour);
        resultTime.set(Calendar.MINUTE, minutes.intValue());
        resultTime.set(Calendar.SECOND, 0);
        resultTime.set(Calendar.MILLISECOND, 0);
        resultTime.setTimeZone(date.getTimeZone());

        return resultTime;
    }
27072
public static LocalDateTime dateToLocalDateTime(Date date) {

        if (date == null) {
            return null;
        }
        return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
    }
679642
public static DateFormat getInstance() {
        if (instance == null) {
            synchronized (instanceLock) {
                if (instance == null) {
                    instance = new ResqueDateFormatThreadLocal();
                }
            }
        }
        return instance.get();
    }
225034
public static LocalDate firstDay(String localDate) {
        LocalDate parse = parse(localDate, DEFAULT_PATTERN);
        return LocalDate.of(parse.getYear(), parse.getMonth(), 1);
    }
971564
public static Date localDateTimeToDate(LocalDateTime localDateTime) {
        Objects.requireNonNull(localDateTime, Required.LOCAL_DATE_TIME.toString());
        
        Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
        return Date.from(instant);
    }
925529
public static Calendar getCalendar(TimeZone tz, Locale locale)
    {
        if(tz == null)
            tz = getCurrentTimeZone();
        if(locale == null)
            locale = getCurrentLocale();
        return Calendar.getInstance(tz, locale);
    }
349866
public static Month toMonth(final Calendar self) {
        return Month.of(self.get(Calendar.MONTH) + 1);
    }
1267487
private static Calendar getInstanceInternal(TimeZone tz, ULocale locale) {
        if (locale == null) {
            locale = ULocale.getDefault(Category.FORMAT);
        }
        if (tz == null) {
            tz = TimeZone.getDefault();
        }

        Calendar cal = createInstance(locale);
        cal.setTimeZone(tz);
        cal.setTimeInMillis(System.currentTimeMillis());
        return cal;
    }