标签: php
我想从给定时间得到总秒数,例如下面给出的数据:
$timein=04-01-2017 7:56:37 am; $timeout=04-01-2017 5:15:17 pm; $totalseconds= ?
答案 0 :(得分:3)
PHP code demo
<?php $time1=strtotime("04-01-2017 7:56:37 am"); $time2=strtotime("04-01-2017 5:15:17 pm"); echo $time2-$time1;