
php哪些函数可以增加一天时间戳,下面web建站小编给大家详细介绍一下!
1、利用time()+一天的秒数增加一天时间戳
<?php
header("Content-type:text/html;charset=utf-8");
echo "当前时间戳为:".time()."<br>";
echo "格式化当后:".date("Y-m-d H:i:s",time())."<br><br>";
$interval = 1 * 24 * 3600;
echo "增加一天的时间戳为:".(time()+$interval)."<br>";
echo "格式化当后:".date("Y-m-d H:i:s",time()+$interval)."<br>";
?>
2、利用strtotime() 函数增加一天时间戳
<?php
header("Content-type:text/html;charset=utf-8");
echo "当前时间戳为:".strtotime("now")."<br>";
echo "格式化后:".date("Y-m-d H:i:s",strtotime("now"))."<br><br>";
echo "增加一天的时间戳为:".strtotime("+1 day")."<br>";
echo "格式化后:".date("Y-m-d H:i:s",strtotime("+1 day"));
?>
上面是“php哪些函数可以增加一天时间戳”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2788.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

ajax接口返回的文件流数据处理方法介绍
搭搭APP最新版
一款专注于提升美学以及出色的排版设计的AI图像生成模型——Reve Image