以 unix 时间戳获取昨天的开始时间 (php)

get start time of yesterday in unix time stamp(php)

如何获取 Unix 时间戳格式的昨天日期?

我想获取昨天的开始时间,例如:

2016:12:25 00:00:00

这将为您提供昨天的时间戳

昨天日期

echo "Yesterday date".time() - 86400; //this will take current time

指定日期的最后一天

$inputedDate = "2016:12:25 00:00:00"; // you can pass date you want
$yesterdayDate = date ("Y-m-d H:i:s",strtotime($inputedDate)-86400);
echo $yesterdayDate;

您只需在格式

之后将 strtotime('-1 day', strtotime('datetime')) 传递给您的 date() 函数,将其减去 1 天
echo date( 'U', strtotime('-1 day', strtotime('2016:12:25 00:00:00')) );

DEMO