PHP的时间格式化问题 我的MYSQL数据库中表中有一个DATE字段,有2条DATE记录,分别是2010-03-30 15:22:10 和 2010-03-30 15:24:34我想用 2010-03-30 15:24:34 减去 2010-03-30 15:22:10 然后得到的值,将它格式化,最终显示为: 00:02:24高手们,帮帮忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 echo $a=strtotime("2010-03-30 18:24:34")-strtotime("2010-03-30 15:22:10 ")."<br>"; mysql> select timediff('2010-03-30 15:24:34','2010-03-30 15:22:10');+-------------------------------------------------------+| timediff('2010-03-30 15:24:34','2010-03-30 15:22:10') |+-------------------------------------------------------+| 00:02:24 |+-------------------------------------------------------+1 row in set (0.00 sec) $a=strtotime("2010-03-30 15:24:34")-strtotime("2010-03-30 15:22:10 ")."<br>";$b=strtotime("2010-03-30")+$a;echo date("H:i:s",$b); echo $a=date('H:i:s',strtotime("2010-03-30 15:24:34")-strtotime("2010-03-30 15:22:10 "))."<br>"; echo date("H:i:s",strtotime("2010-03-30 15:24:34")-strtotime("2010-03-30 15:22:10"))."<br>"; $a = strtotime("2010-03-30 18:24:34")-strtotime("2010-03-30 15:22:10 ");$a = date("h:i:s",$a);echo $a; ysql> select timediff('2010-03-30 15:24:34','2010-03-30 15:22:10');+-------------------------------------------------------+| timediff('2010-03-30 15:24:34','2010-03-30 15:22:10') |+-------------------------------------------------------+| 00:02:24 |+-------------------------------------------------------+1 row in set (0.00 sec)这个不错哦 短信 在本地apache搭建项目时碰到的500错误 求php入门的学习资料(高分相送) 谁能给个必须用ob_start( ) 的例子 PHP 函数拆分 php5中str_replace 使用问题????? 从数据库掉不出数据.. 本地机装php4+apache2,无法打开php页面(50分) 如何判定一个值是否在另一个数组内?(在线等,急) php程序控制打印的问题! 举一个 == 为false ===为true的 php例子 高手帮忙!
mysql> select timediff('2010-03-30 15:24:34','2010-03-30 15:22:10');
+-------------------------------------------------------+
| timediff('2010-03-30 15:24:34','2010-03-30 15:22:10') |
+-------------------------------------------------------+
| 00:02:24 |
+-------------------------------------------------------+
1 row in set (0.00 sec)
$b=strtotime("2010-03-30")+$a;
echo date("H:i:s",$b);
$a = date("h:i:s",$a);
echo $a;
+-------------------------------------------------------+
| timediff('2010-03-30 15:24:34','2010-03-30 15:22:10') |
+-------------------------------------------------------+
| 00:02:24 |
+-------------------------------------------------------+
1 row in set (0.00 sec)
这个不错哦