Dates equal

@param string $value
@param string $comparable

@return bool
511946
public static function dateEqual($value, $comparable, $format = 'Y-m-d')
    {
        $date = date($format, strtotime($value));
        return $date == $comparable;
    }
128133
public static function areNotEqual($value1, $value2): bool
    {
        if (static::isEquatable($value1) && static::areSameType($value1, $value2)) {
            return !$value1->equals($value2);
        }

        return $value1 != $value2;
    }
312228
public function containsValue($value): bool {
        $node = $this->getHead();
        while ($node !== null) {
            if (Comparator::equals($node->getValue(), $value)) {
                return true;
            }
            $node = $node->getNext();
        }
        return false;
    }
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;
    }
281618
public static function isAfter($value, $limit, $inclusive = false)
    {
        $value = self::convertToDateTime($value);
        $limit = self::convertToDateTime($limit);

        if (false === $inclusive) {
            return \strtotime($value->format('Y-m-d H:i:s')) > \strtotime($limit->format('Y-m-d H:i:s'));
        }

        return \strtotime($value->format('Y-m-d H:i:s')) >= \strtotime($limit->format('Y-m-d H:i:s'));
    }
761871
public static function isBetween($value, $minDate, $maxDate, $inclusive = false)
    {
        if (false === $inclusive) {
            return (self::isAfter($value, $minDate, false) && self::isBefore($value, $maxDate, false));
        }

        return (self::isAfter($value, $minDate, true) && self::isBefore($value, $maxDate, true));
    }
1160821
static long comparable(DateValue date) {
  long comp = (((((long) date.year()) << 4) + date.month()) << 5) + date.day();
    if (date instanceof TimeValue) {
      TimeValue time = (TimeValue) date;

      /*
       * We add 1 to comparable for timed values to make sure that timed events
       * are distinct from all-day events, in keeping with DateValue.compareTo.
       * 
       * It would be odd if an all day exclusion matched a midnight event on the
       * same day, but not one at another time of day.
       */
      return (((((comp << 5) + time.hour()) << 6) + time.minute()) << 6) + time.second() + 1;
    }
    return comp << 17;
  }
924466
public static function areEqual($value1, $value2): bool
    {
        if (static::isEquatable($value1) && static::areSameType($value1, $value2)) {
            return $value1->equals($value2);
        }

        return $value1 == $value2;
    }
887063
public static function determineComparison($value)
    {
        switch (true) {
            case is_scalar($value): {
                return static::EQ;
            }
            case is_array($value): {
                return static::IN;
            }
            case null === $value: {
                return static::IS_NULL;
            }
            default: {
                return static::RAW;
            }
        }
    }
842051
public function Equals( $obj )
	{
		if ( ! $obj instanceof TimeValue )
		{
			return false;
		}

		/**
		 * @var DateTimeValueBase $other
		 */
		$other = $obj;
		return $this->ToString( null ) == $other->ToString( null );
	}
527291
public function isValid($value) : bool
    {
        if ($value === null && $this->nullable) {
            return true;
        }

        return $value instanceof \DateTimeImmutable;
    }
59729
public function equalsTo($value)
    {
        if (is_object($value) && $value instanceof Enum) {
            return $value->getValue() == $this->value;
        }
        return $value == $this->value;
    }
761024
protected function compare($value)
    {
        if (!method_exists($this, self::$methodList[$this->operator])) {
            throw new FilterException("Method for {$this->operator} does not exist!");
        }

        return $this->{self::$methodList[$this->operator]}($value, $this->value);
    }
1120461
static long comparable(DateValue dv) {
        long comp = (((((long) dv.year()) << 4) + dv.month()) << 5) + dv.day();
        if (dv instanceof TimeValue) {
            TimeValue tv = (TimeValue) dv;
            // We add 1 to comparable for timed values to make sure that timed
            // events are distinct from all-day events, in keeping with
            // DateValue.compareTo.

            // It would be odd if an all day exclusion matched a midnight event on
            // the same day, but not one at another time of day.
            return (((((comp << 5) + tv.hour()) << 6) + tv.minute()) << 6)
                    + tv.second() + 1;
        } else {
            return comp << 17;
        }
    }
535933
public static function endWith($value, $comparable)
    {
        if (is_array($comparable) || is_array($value) || is_object($comparable) || is_object($value)) {
            return false;
        }
        
        if (preg_match("/$comparable$/", $value)) {
            return true;
        }

        return false;
    }
1297534
public function marshal($value)
    {
        $date = parent::marshal($value);
        if ($date instanceof DateTime) {
            $date->setTime(0, 0, 0);
        }

        return $date;
    }
446560
public function equals($value)
    {
        if ($value instanceof \DateTime) {
            $timestamp = $value->getTimeStamp();
        } else {
            $timestamp = strtotime($value);
        }

        return ($timestamp == $this->value->getTimeStamp());
    }