getDateWithZone, Returns the date picker value as a java.util.Date that was created using the
specified time zone, or returns null. This will return null if either the date picker has no
value, or if the supplied time zone was null.
436359
public java.util.Date getDateWithZone(ZoneId timezone) {
        LocalDate pickerDate = parentDatePicker.getDate();
        if (pickerDate == null || timezone == null) {
            return null;
        }
        Instant instant = pickerDate.atStartOfDay(timezone).toInstant();
        // for backport: java.util.Date javaUtilDate = DateTimeUtils.toDate(instant);
        // for java.time: java.util.Date javaUtilDate = java.util.Date.from(instant);
        // This function was created to be compatible with both libraries.
        java.util.Date javaUtilDate = getJavaUtilDateFromInstant(instant);
        return javaUtilDate;
    }
1003360
public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
      throws SQLException {
    if (lastValueWasNull()) {
      return null;
    }
    switch (columnInfo.getColumnType()) {
      case TIMESTAMP:
      case DATETIME:
        Timestamp ts = getInternalTimestamp(columnInfo, cal, timeZone);
        return (ts == null) ? null : new Time(ts.getTime());
      case DATE:
        throw new SQLException("Cannot read Time using a Types.DATE field");
      default:
        Calendar calendar = Calendar.getInstance();
        calendar.clear();
        int day = 0;
        int hour = 0;
        int minutes = 0;
        int seconds = 0;
        boolean negate = false;
        if (length > 0) {
          negate = (buf[pos] & 0xff) == 0x01;
        }
        if (length > 4) {
          day = ((buf[pos + 1] & 0xff)
              + ((buf[pos + 2] & 0xff) << 8)
              + ((buf[pos + 3] & 0xff) << 16)
              + ((buf[pos + 4] & 0xff) << 24));
        }
        if (length > 7) {
          hour = buf[pos + 5];
          minutes = buf[pos + 6];
          seconds = buf[pos + 7];
        }
        calendar
            .set(1970, Calendar.JANUARY, ((negate ? -1 : 1) * day) + 1, (negate ? -1 : 1) * hour,
                minutes, seconds);

        int nanoseconds = 0;
        if (length > 8) {
          nanoseconds = ((buf[pos + 8] & 0xff)
              + ((buf[pos + 9] & 0xff) << 8)
              + ((buf[pos + 10] & 0xff) << 16)
              + ((buf[pos + 11] & 0xff) << 24));
        }

        calendar.set(Calendar.MILLISECOND, nanoseconds / 1000);

        return new Time(calendar.getTimeInMillis());
    }
  }
106840
@CheckForNull
  public static Date parseDateOrDateTime(@Nullable String stringDate) {
    if (stringDate == null) {
      return null;
    }

    OffsetDateTime odt = parseOffsetDateTimeQuietly(stringDate);
    if (odt != null) {
      return Date.from(odt.toInstant());
    }

    LocalDate ld = parseLocalDateQuietly(stringDate);
    checkArgument(ld != null, "Date '%s' cannot be parsed as either a date or date+time", stringDate);

    return Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant());
  }
321071
private TimeZone getTimeZone() {

        // If no time zone is set, use the default
        String timeZone = getModel().getTimeZone();
        if (timeZone == null)
            return TimeZone.getDefault();

        // Otherwise parse and return time zone
        return TimeZone.getTimeZone(timeZone);

    }
46533
public com.google.privacy.dlp.v2.DateTime.TimeZone getTimeZone() {
    return timeZone_ == null
        ? com.google.privacy.dlp.v2.DateTime.TimeZone.getDefaultInstance()
        : timeZone_;
  }
873053
def _getFromTime(self, atDate=None):
        
        return getLocalTime(self.date_from, self.time_from, self.tz)
1202243
private static DateFormat getDateFormat() {
        SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_STRING);
        dateFormat.setTimeZone(UTC);
        return dateFormat;
    }
640702
private String getDateTimeString(Date value)
   {
      String result = null;
      if (value != null)
      {
         Calendar cal = DateHelper.popCalendar(value);
         StringBuilder sb = new StringBuilder(16);
         sb.append(m_fourDigitFormat.format(cal.get(Calendar.YEAR)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.MONTH) + 1));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.DAY_OF_MONTH)));
         sb.append('T');
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.HOUR_OF_DAY)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.MINUTE)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.SECOND)));
         sb.append('Z');
         result = sb.toString();
         DateHelper.pushCalendar(cal);
      }
      return result;
   }
1304856
public Date getEndDate() {
        DateRange range = getSelectedRange();
        return range == null ? null : range.getEndDate();
    }
123716
private SimpleDateFormat createDateTimeTimeZoneFormat() {
		SimpleDateFormat dateTimeTimeZoneFormat = new SimpleDateFormat( DATE_TIME_TIMEZONE_FORMAT );
		dateTimeTimeZoneFormat.setLenient( false );
		return dateTimeTimeZoneFormat;
	}
612402
@Override
    public ChronoZonedDateTime<D> atZone(ZoneId zoneId) {
        return ChronoZonedDateTimeImpl.ofBest(this, zoneId, null);
    }
498472
@Override
    public ChronoZonedDateTime<D> atZone(ZoneId zone) {
        return ChronoZonedDateTimeImpl.ofBest(this, zone, null);
    }
419735
public Calendar getSelectedDate() {
        Calendar result = dateSpinner.getSelectedDate();
        Calendar time = timeSpinner.getSelectedTime();
        if(result!=null && time!=null) {
            result.set(Calendar.HOUR_OF_DAY, time.get(Calendar.HOUR_OF_DAY));
            result.set(Calendar.MINUTE, time.get(Calendar.MINUTE));
            return result;
        }
        else return null;
    }
927321
@Override
    public Object getValue() {
        Date d = Calendar.getInstance().getTime();
        try {
            d = DEFAULT_DATE_FORMAT.parse(((JTextField) editor).getText());
        } catch (ParseException ex) {
            Logger.getLogger(CalendarStringPropertyEditor.class.getName()).log(Level.SEVERE, null, ex);
        }
        Calendar c = Calendar.getInstance();
        c.setTime(d);
        return c;
    }
1169974
public Date getDate() {
        if (date == null) {
            if (getContext() != null) {
                date = context.now();
            }
        }
        return date;
    }
1053361
public static Date toDate(LocalDate date)
	{
		if(date == null)
			return null;
		
		return  java.util.Date
	      .from(date.atStartOfDay(ZoneId.systemDefault())
	      .toInstant());
	}
222521
def _getFromTime(self, atDate=None):
        
        return getLocalTime(self.date, self.time_from, self.tz)