Validates the date time is greater than the supplied date time

@param \DateTimeInterface $value

@return static
502259
public function lessThan(\DateTimeInterface $value)
    {
        $value = $this->processDateTime($value);

        return $this->attr(DateTimeTypeBase::ATTR_LESS_THAN, $value);
    }
351786
public static function execute($value, ContextInterface $context): array
    {
        return $value instanceof DateTimeInterface ?
            static::createSuccessReply($value) :
            static::createErrorReply($context, $value, ErrorCodes::IS_DATE_TIME, Messages::IS_DATE_TIME, []);
    }
216533
public function setValue($value)
    {
        if ($value instanceof DateInterval) {
            $value = Utils::now()->add($value);
        }

        if ($value instanceof DateTimeInterface) {
            $value = $value->getTimestamp();
        }

        return parent::setValue($value);
    }
1007208
protected function prepareDateTime($value)
    {
        if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
            // Actually performing this conversion may not be an issue. Wait
            // until it is raised before making a decision.
            throw new \UnexpectedValueException(
                "Incoming time zone {$value->getTimeZone()->getName()} did not match app time zone {$this->appTimeZone->getName()}"
            );
        }
        $value = clone $value;
        $value = $value->setTimeZone($this->dbTimeZone);
        if ($this->forceTime) {
            $value = $value->setTime(...$this->forceTime);
        }
        return $value;
    }
75091
public function setByMinute($value)
    {
        if (!is_integer($value) || $value < 0 || $value > 59) {
            throw new \InvalidArgumentException('Invalid value for BYMINUTE');
        }

        $this->byMinute = $value;

        $this->canUseBySetPos = true;

        return $this;
    }
545997
protected function aboveMaxBorder($value): bool
    {
        if (null === $this->maxDate) {
            return false;
        }

        if (!($value instanceof Datespan)) {
            throw new LogicException('Given value must be of instance ' . Datespan::class);
        }

        return $value->endsAfter($this->maxDate->change()->timeTo('23:59:59'));
    }
937991
public function isValidDate($value)
    {
        if (!$value) {
            return false;
        }

        try {
            new \DateTime($value);

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
1300924
protected function _validate_timestamp($value, $parameters)
    {
        $timestamp = is_numeric($value) ? (int)$value : strtotime($value);
        if ($timestamp === false) {
            return null;
        }

        if (isset($parameters[0])) {
            if ($parameters[0] === 'start') {
                /** @noinspection SummerTimeUnsafeTimeManipulationInspection */
                return (int)($timestamp / 86400) * 86400;
            } elseif ($parameters[0] === 'end') {
                /** @noinspection SummerTimeUnsafeTimeManipulationInspection */
                return (int)($timestamp / 86400) * 86400 + 86399;
            } else {
                return strtotime(date($parameters[0], $timestamp));
            }
        }

        return $timestamp;
    }
613105
public static function parseValue($value)
    {
        if ($value instanceof DateTimeInterface) {
            $value = $value->format('Y-m-d H:i:s');
        } elseif ($value instanceof DateTimeProperty) {
            $value = $value->storageVal($value->val());
        } elseif (is_string($value)) {
            $str = strtolower($value);
            if ($str === 'true') {
                $value = true;
            } elseif ($str === 'false') {
                $value = false;
            }
        }

        return $value;
    }
30813
public static function datetime(string $value): bool
    {
        $matches = preg_match('/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/', $value);
        return is_int($matches) && $matches > 0;
    }
850270
public function validate($value) {
        $dateTime = \DateTime::createFromFormat($this->format, $value);
        if(!$dateTime instanceof \DateTime || $dateTime->format($this->format)!=$value) {
            return new ValidationResult(false, 'Invalid date');
        }

        return new ValidationResult(true);
    }
444956
public function setValue($value)
    {
        if ($value instanceof DateTimeInterface) {
            $this->setDateTime($value);
        } else {
            parent::setValue($value);
        }
    }
394422
protected function processDateTime(\DateTimeInterface $value)
    {
        $newDateTime = \DateTimeImmutable::createFromFormat(
                'Y-m-d H:i:s',
                $value->format('Y-m-d H:i:s'),
                $value->getTimezone()
        );

        return DateTimeProcessor::zeroUnusedParts($this->type->getMode(), $newDateTime);
    }
1349052
private function validateDateTime($value): void
    {
        try {
            if(
                is_a($value, DateTime::class) ||
                is_null($value) ||
                $value === 'now'
            ) {
                // Expected and valid values, no need to attempt conversion
            } else {
                if($this->isUnixTimestamp($value)) {
                    // Try making a DateTime with a UNIX Timestamp from a string
                    DateTime::createFromFormat("U.u", $this->unixTimestampAsUuFormat($value));
                } else {
                    // Try making a DateTime with whatever remains
                    new DateTime($value);
                }
            }
        } catch (Exception $e) {
            throw new TypeValidationException('Attempted to pass non-date[time] value to date[time] type');
        }
    }
1167864
protected function validateDatetime($value, ValidationField $field) {
        if ($value instanceof \DateTimeInterface) {
            // do nothing, we're good
        } elseif (is_string($value) && $value !== '' && !is_numeric($value)) {
            try {
                $dt = new \DateTimeImmutable($value);
                if ($dt) {
                    $value = $dt;
                } else {
                    $value = null;
                }
            } catch (\Throwable $ex) {
                $value = Invalid::value();
            }
        } elseif (is_int($value) && $value > 0) {
            try {
                $value = new \DateTimeImmutable('@'.(string)round($value));
            } catch (\Throwable $ex) {
                $value = Invalid::value();
            }
        } else {
            $value = Invalid::value();
        }

        if (Invalid::isInvalid($value)) {
            $field->addTypeError($value, 'date/time');
        }
        return $value;
    }
394745
private function upgradeDate(&$value)
    {
        if ($value instanceof \DateTime) {
            return $value;
        }

        $value = \DateTime::createFromFormat('Y-m-d', $value);

        return $value;
    }
371462
protected function parseAsDateTime($value)
    {
        if (empty($value) && !is_numeric($value)) {
            return null;
        }

        if (is_string($value)) {
            try {
                $value = new DateTime($value);
            } catch (Exception $e) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid date/time value: %s',
                    $e->getMessage()
                ), $e->getCode(), $e);
            }
        }

        if (!$value instanceof DateTimeInterface) {
            throw new InvalidArgumentException(
                'Invalid date/time value. Must be a date/time string or an implementation of DateTimeInterface.'
            );
        }

        return $value;
    }