date时间大全
<?php
echo "今天:".date("Y-m-d")."<br>";
echo "昨天:".date("Y-m-d", strtotime("-1 day")), "<br>";
echo "明天:".date("Y-m-d", strtotime("+1 day")). "<br>";
echo "一周后:".date("Y-m-d", strtotime("+1 week")). "<br>";
echo "一周零两天四小时两秒后:".date("Y-m-d G:H:s", strtotime("+1 week 2 days 4 hours 2 seconds")). "<br>";
echo "下个星期四:".date("Y-m-d", strtotime("next Thursday")). "<br>";
echo "上个周一:".date("Y-m-d", strtotime("last Monday"))."<br>";
echo "一个月前:".date("Y-m-d", strtotime("last month"))."<br>";
echo "一个月后:".date("Y-m-d", strtotime("+1 month"))."<br>";
echo "十年后:".date("Y-m-d", strtotime("+10 year"))."<br>";
#昨天
echo date("Y/m/d h:i:s", time()-24*60*60);
echo "<br>";
#前天
echo date("Y/m/d h:i:s", time()-2*24*60*60);
date("Y/m/d H:i:s", strtotime("1 days ago"));
date("Y/m/d H:i:s", strtotime("2 days ago"));
date("Y/m/d H:i:s", mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));
$time_yes = localtime(time()-24*60*60, true);
$time_b_yes = localtime(time()-2*24*60*60, true);
$yesterday = $time_yes['tm_mday'];
$the_day_before_yes = $time_b_yes['tm_mday'];
//昨天
print date('Y-m-d', strtotime('-1 day'));
//上星期
print date('Y-m-d', strtotime('-1 week'));
//上个月
print date('Y-m-d', strtotime('-1 month'));
//去年
print date('Y-m-d', strtotime('-1 year'));
//strtotime得到一个时间戳, 然后你自己格式化.
strtotime('yesterday');
strtotime('-2 day');
网友回复
js如何流式输出ai的回答并折叠代码块,点击代码块右侧可预览代码?
ai大模型如何将文章转换成可视化一目了然的图片流程图图表?
大模型生成html版本的ui原型图和ppt演示文档的系统提示词怎么写?
rtsp视频直播流如何转换成websocket流在h5页面上观看?
为啥coze会开源工作流agent coze studio?
如何检测网页是通过收藏夹打开的?
python如何实现类似php的http动态脚本请求处理响应代码?
js如何实现类似php的http动态脚本请求处理响应代码?
trae与solo有啥区别不同?
vue如何让ai动态生成问卷调查多步骤表单式收集基础信息自动规划执行任务?