返回列表 上一主題 發帖

[發問] 時間計數?

[發問] 時間計數?

請問一下
如果記錄一件物品安裝的時間到目前為止共使用多少小時
程式該如何撰寫呢?

回復 1# terence0916
  1. <?
  2. $nowtime = date("Y-m-d H:00:00");
  3. $settime = "2014-10-31 08:00:00";
  4. $subtraction = (strtotime($nowtime)-strtotime($settime)/(60*60));
  5. echo $subteaction;
  6. ?>
複製代碼

TOP

        靜思自在 : 盡多少本份,就得多少本事。
返回列表 上一主題