I want to check if my date isn't greater than today. I write this code but it isn't work:
public function getDate() {
$month = $this->month;
return $this->year . '-' . $month . '-' . $this->day;
}
public function getDbFormatedDate() {
if (checkdate($this->month, $this->day, $this->year) || $this->strtotime(getDate())>strtotime(date("Y-m-d"))){
$dateDeadline = date_create($this->getDate());
$this->BirthDate = date_format($dateDeadline, 'Y-m-d');
Yii::$app->session->setFlash('success', Yii::t('app', 'Zmiany w profilu zostały zapisane'));
} else {
Yii::$app->getSession()->setFlash('error', 'nie ma takeij daty');
}
}