public static Object now(UICalendar uicalendar, Class<?> dateType) {
        Temporal now = now(uicalendar);
        if (dateType.isAssignableFrom(java.util.Date.class)) {
            ZoneId zone = calculateZoneId(uicalendar.getTimeZone());
            java.util.Date date;
            if (now instanceof LocalDate) {
                date = java.util.Date.from(((LocalDate) now).atStartOfDay(zone).toInstant());
            }
            else if (now instanceof LocalTime) {
                date = java.util.Date.from(((LocalTime) now).atDate(LocalDate.now(zone)).atZone(zone).toInstant());
            }
            else {
                date = java.util.Date.from(((LocalDateTime) now).atZone(zone).toInstant());
            }
            return date;
        }
        return now;
    }
Calculates NOW based on the calendar's current timezone or will default to system timezone if none set.

@param uicalendar the base calendar to calculate NOW for
@return an Object representing either a Date or Temporal
primefaces/src/main/java/org/primefaces/util/CalendarUtils.java