欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP獲取昨天、今天及明天日期的方法

 更新時間:2016年02月03日 10:54:06   作者:pythoner  
這篇文章主要介紹了PHP獲取昨天、今天及明天日期的方法,涉及PHP針對時間與日期的相關操作技巧,非常簡單實用,需要的朋友可以參考下

本文實例講述了PHP獲取昨天、今天及明天日期的方法。分享給大家供大家參考,具體如下:

//PHP返回昨天的日期
function get_last_date() {
 $tomorrow = mktime(0,0,0,date("m"),date("d")-1,date("Y"));
 return date("Y-m-d", $tomorrow);
}
//PHP返回今天的日期
function get_today_date() {
 $today=date("Y-m-d");
 return today;
}
//PHP返回明天的日期
function get_tomorrow_date() {
 $tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
 return date("Y-m-d", $tomorrow);
}

更多關于php相關內容感興趣的讀者可查看本站專題:《php日期與時間用法總結》、《php常用函數(shù)與技巧總結》及《php面向對象程序設計入門教程

希望本文所述對大家PHP程序設計有所幫助。

相關文章

最新評論