2016-12-26 93 views

回答

1

這將讓你昨天的timestemp

昨天日期

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

對於最後一天f ROM一天

$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; 
0

你只需1天你的格式

echo date('U', strtotime('-1 day', strtotime('2016:12:25 00:00:00'))); 

DEMO

+0

http://www.epochconverter.com/之後傳遞strtotime('-1 day', strtotime('datetime'))date()功能減去它說:GMT:週五,2016年12月23日23:00:00 GMT –

+0

@addadsaasddasdas轉換器是錯誤的看到這個 https://gyazo.com/7773c2df60be4e152ef352e39c6b2830 https://gyazo.com/66c46e94b65341f4b2fc06d19a2451d2,您傳遞了不同的時間戳。不是時間戳來自我的PHP小提琴 – Beginner