php 判断该时间戳是否在当日

来源:csdn博客 分类: 文章浏览史 发布时间:2020-05-15 21:38:00 最后更新:2020-05-15 浏览:420
转载声明:
本文为摘录自“csdn博客”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2020-05-15 21:38:00

 

function checktime($time){
 $ystd = strtotime(date("Y-m-d"));
 $ystd = date("Y-m-d",$ystd);
 $ystd = strtotime($ystd."00:00:00");
 
 $today = strtotime('+1 day');
    $today = date("Y-m-d",$today);
    $today = strtotime($today."00:00:00");
 
 
  if($ystd < $time and  $time < $today){
  
   return true;
  }else{
  
   return false; 
  }
 
 
 
}

 

该方法适合用在一些 签到的程序  ,根据取出的时间戳 判断是否在当天 ,返回布尔类型

php技术微信