$current _ date _ only = $current _ date [ year ] .’-’. $current _ date [ mon ] .’-’. $current _ date [ mday ] ;
$current _ time _ only = $current _ date [‘ hours’] .’:’. $current _ date [‘ minutes’] .’:’. $current _ date [‘ second’] ;
比较它取决于你是否使用 donly 日期或日期时间在你的数据库:
$today = $current _ date _ only.’. $current _ time _ only;