Validate and set the datetime field on the screen given a date.
@param dateTime The datetime object
967032
public void setDateTime(Date dateTime)
    {
        String dateTimeString = "";
        if (dateTime != null)
    		dateTimeString = dateTimeFormat.format(dateTime);
        jTextField4.setText(dateTimeString);
        jCalendarButton2.setTargetDate(dateTime);
        jTimeButton2.setTargetDate(dateTime);
    }
612428
public function setDateFromDateTime(DateTime $date = NULL, DateTimeZone $dateTimeZone = NULL) {
    $dateTimeZone = !empty($dateTimeZone) ? $dateTimeZone : new DateTimeZone('UTC');
    $this->date = !empty($date) ? $date : new DateTime($date);
    $this->date->setTimezone($dateTimeZone);
  }
1222722
public function setLastLoginTime(\DateTime $time = null)
	{
		if (is_null($time)) {
			$time = new \DateTime();
		}
		$this->lastLoginTime = $time;
	}
442564
private static function validateDateTime($datetime)
	    {
	        if ($datetime instanceof DateTimeInterface || $datetime instanceof DateTime) {
	            return $datetime;
	        }

	        return new DateTime((string) $datetime);
	    }
911444
@Override
    public void setTime(int parameterIndex, Time x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        throw SQLError.noSupport();
    }
410361
public void setEvaluationTime(com.google.api.ads.admanager.axis.v201808.DateTime evaluationTime) {
        this.evaluationTime = evaluationTime;
    }
310444
public void setDate(String date) {
        if (date == null || date.trim().isEmpty()) {
            throw new IllegalArgumentException("Date cannot be null or empty.");
        }
        try {
            Date dateToSet = new SimpleDateFormat("MM/dd/yyyy").parse(date);
            Calendar to = Calendar.getInstance();
            to.setTime(dateToSet);
            setDate(to);
        } catch (ParseException e) {
            throw new IllegalArgumentException(e);
        }
    }
809441
public void setDateReleased(String dateReleased) {

        try {
            if (dateReleased != null) {
                m_resourceBuilder.setDateReleased(convertTimestamp(dateReleased));
            } else {
                m_resourceBuilder.setDateReleased(CmsResource.DATE_RELEASED_DEFAULT);
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
310703
def set_value(self, value: datetime):
        
        assert isinstance(value, datetime)

        self.value = value
1308154
static public function validate($datetime)
    {
      // Break into parts
      $parts = preg_split('/[T ]/', $datetime);
      
      return Date::validate($parts[0]) && Time::validate($parts[1]);
    }
1130040
public function setDatetime($dateTime)
    {
        $dt = strtotime($dateTime);
        if ($dt == -1) {
            $this->setError(
                "Date of " . $dateTime
                . " Cannot be parsed correctly. It should be in"
                . " a format parsable by PHP's strtotime() function."
            );
        } else {
            $this->dateTime = $dateTime;
            $this->setSeconds($dt);
        }
    }
993517
public static DateTime offset(Date date, DateField dateField, int offset) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(dateField.getValue(), offset);
		return new DateTime(cal.getTime());
	}
234086
public static function isValidDateTime($dateTime)
    {
        $t = explode(' ', $dateTime);
        if ($this->isValidDate($t[0]) && $this->isValidDate($t[1])) {
            return true;
        } else {
            return false;
        }
    }
881177
public void checkForTimeAndDate(final ZonedDateTime DATE_TIME) {
        if (days.contains(DATE_TIME.getDayOfWeek())) { checkForTime(DATE_TIME.toLocalTime()); }
    }
691264
public DateTime setField(int field, int value) {
		final Calendar calendar = toCalendar();
		calendar.set(field, value);

		DateTime dt = this;
		if (false == mutable) {
			dt = ObjectUtil.clone(this);
		}
		return dt.setTimeInternal(calendar.getTimeInMillis());
	}
305285
public function setDateTime($parameterIndex, \DateTime $dateTime)
    {
        $this->setParameter($parameterIndex, $dateTime->format(Constants::QUERY_DATETIMEFORMAT));
    }
1225795
public void setTime(String timeString)
    {
		Date time = null;
		try	{
            if ((timeString != null) && (timeString.length() > 0))
                time = timeFormat.parse(timeString);
		} catch (Exception e)	{
            time = null;
		}
        this.setTime(time);
    }