首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php 日期操作 天数添1

2012-06-30 
php 日期操作 天数加1??#给定一个日期:$s 2012-05-28 14:23:43#在这个日期上加上1天 得到新日期echo d

php 日期操作 天数加1

?

?

#给定一个日期:$s= '2012-05-28 14:23:43';#在这个日期上加上1天 得到新日期echo date('Y-m-d H:i:s',strtotime("$s +1 day"));#输出 2012-05-29 14:23:43
4.strstotime()函数转化时间戳echo(strtotime("now")); //1138614504echo(strtotime("3 October 2005")); //1128290400echo(strtotime("+5 hours")); //1138632504echo(strtotime("+1 week")); //1139219304echo(strtotime("+1 week 3 days 7 hours 5 seconds")); //1139503709echo(strtotime("next Monday")); //1139180400echo(strtotime("last Sunday")); //1138489200
?

热点排行