1 頁 (共 1 頁)

php date日期函式之日期增減用法

發表於 : 2011-01-14 16:49:05
yehlu
http://phpwrite.blogspot.com/2011/01/php-date.html

代碼: 選擇全部

# currentDate = date("Y-m-d");// current date  
# echo "Current Date: ".$currentDate."<br>";  
#   
# $date30DaysAdded = date('Y-m-d', strtotime("+30 days"));  
# echo "30 Days added: ".$date30DaysAdded."<br>";  
#   
# $date10YearsBack = date('Y-m-d', strtotime("-10 years"));  
# echo "10 Years back: ".$date10YearsBack."<br>";  
#   
# $date2DaysAdded = date('Y-m-d', strtotime("+2 days"));  
# echo "2 Days Added: ".$date2DaysAdded."<br>";