
实例11:日期戳、日期显示
echo time();//返回一串以秒计算的时间数字戳
echo “”;
echo date(“Y-m-d H:i:s”,time() 8*3600);//格式化时间, 8*3600变为中国时区时间
echo “”;
$str=”2010-08-24 10:26:10″;
echo date(“Y-m-d H:i:s”,strtotime($str));//strtotime将字符串转为时间戳
echo “”;
?
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...