duanqiao2225 2011-07-29 01:33
浏览 45
已采纳

PHP - 将两组数字(hr和min)转换为时间

In php is there a way to turn two integers (09 and 30) into into type time (9:30). I need this function so I can INSERT these number into a column in MySQL of type time.

  • 写回答

5条回答 默认 最新

  • douweibeng5219 2011-07-29 01:37
    关注

    setTime

    $datetime = new DateTime(); 
    $datetime->setTime(9, 30, 0); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?