通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
``` date_default_timezone_set('PRC'); $today = getdate(strtotime('2003-06-17 21:58:40')); print_r($today); /*结果: Array ( [seconds] => 40//秒的数字表示`0`到`59` [minutes] => 58//分钟的数字表示`0`到`59` [hours] => 21//小时的数字表示`0`到`23` [mday] => 17//月份中第几天的数字表示`1`到`31` [wday] => 2//星期中第几天的数字表示`0`(周日) 到`6`(周六) [mon] => 6//月份的数字表示 1 到 12 [year] => 2003//4 位数字表示的完整年份 [yday] => 167//一年中第几天的数字表示`0`到`365` [weekday] => Tuesday//星期几的完整文本表示 `Sunday`到`Saturday` [month] => June//月份的完整文本表示,比如 January 或 March [0] => 1055901520//自从 Unix 纪元开始至今的秒数,和[time()](https://www.php.net/manual/zh/function.time.php)的返回值以及用于[date()](https://www.php.net/manual/zh/function.date.php)的值类似 ) */ strtotime返回时间戳 指定日期加一天 $time=strtotime("+1 day",strtotime('2025-12-25')), $time1=date("Y-m-d H:i:s",$time); //当前时间减一天 $time1=date("Y-m-d H:i:s",time()-3600*24); print_r($time1);//2018-04-26 12:02:15 $time2 = date("Y-m-d H:i:s",strtotime("-1 day")); print_r($time2);//2018-04-26 12:02:15 //mktime(时,分,秒,月,日,年);//获得一个日期的时间戳 $today_start= mktime(0,0,0,4,27,2018); $time3 = date("Y-m-d H:i:s",$today_start); print_r($time3);//2018-04-27 00:00:00 // 当天的零点时间戳 $dayBegin = strtotime(date('Y-m-d', time())); // 当天的24点时间戳 $dayEnd = $dayBegin + 24 * 60 * 60; //2016-11-01 00:00:00 $todayStart= date('Y-m-d 00:00:00', time()); //2016-11-01 23:59:59 $todayEnd= date('Y-m-d 23:59:59', time()); ```