0
我试图在Yii2中比较datetime
s到time
s,同时使用今天的日期作为基准。我得这一行,但我敢肯定它是不是这样做的正确方法(和不工作):如何将时间与今天的日期进行比较?
$items = mtype::find()->select(["id"])->where(["<","last_run","from_unixtime(unix_timestamp(curdate())+unix_timestamp(concat('1970-01-01 ',time_format(curtime(),'%H:%i:00'))))"])->asArray()->all();
你存储“last_run”在timestemp? –
$ items = mtype :: find() - > select([“id”]) - > where([“<”,“last_run”,time()] - > asArray() - > all(); –
@YasinPatel:last_run是'datetime'。 – Exec