代码实现
<?php
$a = strtotime('now');
$b = strtotime('05 May 2020');
$str = '2020年06月23号';
$arr = date_parse_from_format('Y年m月d日',$str);
$time = mktime(0,0,0,$arr['month'],$arr['day'],$arr['year']);
echo $str.'==>$str时间戳:'.$time."<br /><br />";
echo '当前时间时间戳:'.$a."<br /><br />";
echo '$a输出时间日期:'.date('Y-m-d H:i:s',$a)."<br /><br />";;
echo '05 May 2020时间戳:'.$b."<br /><br />";
echo '$b输入时间日期为:'.date('Y-m-d H:i:s',$b)."<br /><br />";;
$d = ceil(($a - $b) / (3600*24));
$e = ceil(($time - $b) / (3600*24));
echo '距离$b已过去:'.$d.'天'."<br /><br />";
echo '距离$str已过去:'.$d.'天'."<br /><br />";
结果
2020年06月23号==>$str时间戳:1592841600
当前时间时间戳:1592898169
$a输出时间日期:2020-06-23 15:42:49
05 May 2020时间戳:1588608000
$b输入时间日期为:2020-05-05 00:00:00
距离$b已过去:50天
距离$str已过去:50天