這是我想早點或晚點得到的代碼謝謝寶
$current_time = strtoupper(date("g:i a "));
$time = strtoupper(date("g:i a ",strtotime($current_time)));
//print_r($time);
$start_time = $request->start_time;
$s_time = str_replace('/', '-', $start_time);
$fstart_time= strtoupper(date('g:i a',strtotime($s_time)));
//print_r($fstart_time);
if ($time > $fstart_time){
print_r('early');
}else{
print_r('late');
}
uj5u.com熱心網友回復:
這是您格式的簡單解決方案
if (time() >= strtotime($request->start_time)) {
print_r('early');
} else {
print_r('late');
}
uj5u.com熱心網友回復:
更新我解決了我的問題但提前謝謝你
這是我的代碼
$start_time = $request->start_time;
$s_time = str_replace('/', '-', $start_time);
$fstart_time= strtoupper(date('g:i a',strtotime($s_time)));
print_r($fstart_time);
if (time() >= strtotime($fstart_time)) {
echo "early";
} else{
echo "late";
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/430646.html
上一篇:重繪后如何保持復選框處于選中狀態
