php 时间转换日期与日期转换成时间
<?php $d ='2009-07-02 09:09:00'; echo date("Y-m-d",'1246606382'); echo date('Ymd',dateToTime($d)); $temp = dateToTime($d); echo $temp; echo date("Y-m-d",$temp); function dateToTime($d) { $year=((int)substr("$d",0,4));//取得年份 $month=((int)substr("$d",5,2));//取得月份 $day=((int)substr("$d",8,2));//取得几号 return mktime(0,0,0,$month,$day,$year); }
文章链接:http://www.phprm.com/code/458b0f99a250f55286713709fd9d2309.html
随便收藏,请保留本文地址!