🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ $d = "2013-03-26 15:30:10"; $d1 = "2013-03-26 18:40:10"; function minDiff($startTime, $endTime) {     $start =strtotime($startTime);     $end =strtotime($endTime);     $timeDiff = $end -$start; //case "y": $retval = bcdiv($diff,(60 * 60 * 24 * 365)); break; //case "m": $retval = bcdiv($diff,(60 * 60 * 24 * 30)); break; //case "w": $retval = bcdiv($diff,(60 * 60 * 24 * 7)); break; //case "d": $retval = bcdiv($diff,(60 * 60 * 24)); break; //case "h": $retval = bcdiv($diff,(60 * 60)); break; //case "n": $retval = bcdiv($diff,60); break;    //return floor($timeDiff / (60 * 60 *24));//计算天数     return floor($timeDiff /60);//差幾分鐘 } echo dateDiff($d,$d1) ~~~