现在的位置: 首页 > 综合 > 正文

PHP对时间日期的操作

2013年08月10日 ⁄ 综合 ⁄ 共 203字 ⁄ 字号 评论关闭

1.日期时间加减

$time="2005-12-20"通过函数转变为$time="2005-12-21

两种方法

a.unix时间戳

b.使用date()

$time = date("Y-m-d",(strtotime($time)+3600*24))

<?php
$time="2005-12-20";
echo date("Y-m-d",(strtotime("+1 days",strtotime($time))));
?>

抱歉!评论已关闭.