Compare the current date with the given date. Return -1 if current date is less than given date, 0 if equal,
and 1 if greater. Null dates are considered the earliest possible date.

@param QDateTime $dttCompare
@return int
977910
public function compare(QDateTime $dttCompare)
    {
        // All comparison operations MUST have operands with matching Date Nullstates
        if ($this->blnDateNull && !$dttCompare->blnDateNull) {
            return -1;
        } elseif (!$this->blnDateNull && $dttCompare->blnDateNull) {
            return 1;
        }

        // If mismatched Time nullstates, then only compare the Date portions
        if ($this->blnTimeNull != $dttCompare->blnTimeNull) {
            // Let's "Null Out" the Time
            $dttThis = new QDateTime($this);
            $dttThat = new QDateTime($dttCompare);
            $dttThis->Hour = null;
            $dttThat->Hour = null;
        } else {
            $dttThis = $this;
            $dttThat = $dttCompare;
        }
        return ($dttThis->Timestamp < $dttThat->Timestamp ? -1 : ($dttThis->Timestamp == $dttThat->Timestamp ? 0 : 1));
    }
545017
public static boolean isCurrentTimeBetweenTowTimes(Date fromDate, Date fromTime, Date toDate, Date timeTo) {
		JKTimeObject currntTime = getCurrntTime();
		JKTimeObject fromTimeObject = new JKTimeObject();
		JKTimeObject toTimeObject = new JKTimeObject();
		if (currntTime.after(fromTimeObject.toTimeObject(fromDate, fromTime)) && currntTime.before(toTimeObject.toTimeObject(toDate, timeTo))) {
			return true;
		}
		return false;
	}
510223
public function getStartDate() : ?int 
    {
        if ( ! $this->hasStartDate()) {
            $this->setStartDate($this->getDefaultStartDate());
        }
        return $this->startDate;
    }
337802
public function setFromQDateTime(QDateTime $dttFrom, QDateTime $dttTo)
    {
        $this->add($dttFrom->difference($dttTo));
    }
168057
public static function getDayStart($ts = 'now', $format = 'U', $tz = null) {
		if (!Util::isValidTimezone($tz)) {
			$tz = Util::getClientTimezone();
		}
		
		$dt = new DateTime(null, new DateTimeZone($tz));
		(is_int($ts)) ? $dt->setTimestamp($ts) : $dt->modify($ts);
		$dt->setTime(0, 0, 0);
		return $dt->format($format);
	}
149127
public static function date($min = null, $max = null, $formatReturn = null) {
		if ($min === null && $max === null) {
			$res = time();
		} elseif ($min > 0 && $max === null) {
			$res = $min;
		} elseif ($min > 0 && $max > 0) {
			$res = static::int($min, $max);
		} else {
			$res = time();
		}

		$res = 0;
		$formatReturnAs = FORMAT_DB_DATETIME;
		if ($formatReturn !== null) {
			if ($formatReturn === false) {
				return $res;
			}
			$formatReturnAs = $formatReturn;
		}
		return date($formatReturnAs);
	}
480552
public function getStart(): ?\DateTimeInterface
    {
        $lowest_date = null;
        foreach ($this->events as $event) {
            if (null === $lowest_date || $event->getStart() < $lowest_date) {
                $lowest_date = $event->getStart();
            }
        }

        return $lowest_date;
    }
221440
public function difference(QDateTime $dttDateTime)
    {
        $intDifference = $this->Timestamp - $dttDateTime->Timestamp;
        return new DateTimeSpan($intDifference);
    }
449343
public function currentUtcDatetime()
    {
        if ($this->timeFormat === static::$timeFormatDatetime) {
            return gmdate('Y-m-d H:i:s');
        }
        if ($this->timeFormat === static::$timeFormatTimestamp) {
            return time();
        }
        return null;
    }
502341
public function getTempoEspera()
    {
        if ($this->tempoEspera) {
            return $this->secondsToDateInterval($this->tempoEspera);
        }
        
        $now = new DateTime();
        $interval = $now->diff($this->getDataChegada());

        return $interval;
    }
46695
public static function isPresent($date, $time = null)
    {
        if (is_null($time)) {
            $time = self::time();
        }
        if (!is_int($date)) {
            $date = self::strtotime($date);
        }

        return $time === $date;
    }
22931
public static function compare($date1, $date2): int
    {
        $d1 = static::create($date1);
        $d2 = static::create($date2);

        return ($d1 > $d2) ? static::DATETIME_GREATER : (($d1 < $d2) ? static::DATETIME_LESS : static::DATETIME_EQUAL);
    }
355773
public function compare(TimePoint $timepoint)
    {
        $first = $this->date;
        $second = $this->timePointToDateTime($timepoint);
        if ($first < $second) {
            return -1;
        }
        if ($first > $second) {
            return 1;
        }
        return 0;
    }
1152557
@Override
    public int compare(GregorianCalendar c1, GregorianCalendar c2) {
        if (c2.getGregorianChange() == null) {
            return (int) (c1.getTime().getTime() - c2.getTime().getTime());
        } else {
            return 0;
        }
    }
979725
public static function ifIsBigDate($date1,$date2){

		if(strtotime($date1) > strtotime($date2)){
				return 1;
		}else if(strtotime($date1) == strtotime($date2)){
				return 0;
		}else{
				return -1;
		}
    }
850464
public function getLastUpdatedAt()
    {
        $qb = $this->createQueryBuilder('p');

        $date = $qb
            ->select('p.updatedAt')
            ->addOrderBy('p.updatedAt', 'DESC')
            ->getQuery()
            ->setMaxResults(1)
            ->getSingleScalarResult();

        if (null !== $date) {
            return new \DateTime($date);
        }

        return null;
    }
541095
public function isBirthday(Date $dt = null)
    {
        $dt = $dt ?: static::now($this->getTimezone());

        return $this->format('md') === $dt->format('md');
    }