• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/mysql/database.php
  • Класс: CDatabaseMysql
  • Вызов: CDatabaseMysql::CompareDates
public function CompareDates($date1, $date2)
{
	$s_date1 = $this->CharToDateFunction($date1);
	$s_date2 = $this->CharToDateFunction($date2);
	$strSql = "
		SELECT
			if($s_date1 > $s_date2, 1,
				if ($s_date1 < $s_date2, -1,
					if ($s_date1 = $s_date2, 0, 'x')
			)) as RES
		";
	$z = $this->Query($strSql);
	$zr = $z->Fetch();
	return $zr["RES"];
}