php 前一天或后一天的日期

前端之家收集整理的这篇文章主要介绍了php 前一天或后一天的日期前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="4917" class="copybut" id="copybut4917" onclick="doCopy('code4917')"> 代码如下:

<div class="codebody" id="code4917">
<?PHP
date_default_timezone_set('PRC');//默认时区
echo"今天:",date("Y-m-d",time()),"
";
echo"今天:",strtotime("18june2008")),"
";
echo"昨天:",strtotime("-1day")),"
";
echo"明天:",strtotime("+1day")),"
";
echo"一周后:",strtotime("+1week")),"
";
echo"一周零两天四小时两秒后:",date("Y-m-dG:H:s",strtotime("+1week2days4hours2seconds")),"
";
echo"下个星期四:",strtotime("nextThursday")),"
";
echo"上个周一:".date("Y-m-d",strtotime("lastMonday"))."
";
echo"一个月前:".date("Y-m-d",strtotime("lastmonth"))."
";
echo"一个月后:".date("Y-m-d",strtotime("+1month"))."
";
echo"十年后:".date("Y-m-d",strtotime("+10year"))."
";
?>
PHP判断一个日期距今天还有多少天
<div class="codetitle"><a style="CURSOR: pointer" data="96631" class="copybut" id="copybut96631" onclick="doCopy('code96631')"> 代码如下:
<div class="codebody" id="code96631">
<?PHP
echo (strtotime('2020-5-20′)-strtotime(date(“Y-m-d”)))/86400;
?>

猜你在找的PHP相关文章