【发布时间】:2021-09-13 04:38:34
【问题描述】:
我正在使用以下代码来比较 DB DateTime 和输入字段 DateTime 是否相等但它不起作用,请帮我解决这个问题-
$appointment_time = $this->Appointments->find()->select(['appointment_time']);
$appointment_time1 = $this->request->getData('appointment_time');
$dt = ($appointment_time == $appointment_time1);
【问题讨论】:
-
假设预约时间完全相等,
$dt将返回true。否则它将返回false。
标签: php mysql datetime cakephp compare