方法一:使用PHP内置函数date()
$currentDate = date("Y-m-d");
方法二:使用PHP内置函数getdate()
$currentDateArray = getdate();
$currentDate = $currentDateArray["year"] . "-" . $currentDateArray["mon"] . "-" . $currentDateArray["mday"];
方法三:使用PHP内置类DateTime
$currentDateObject = new DateTime();
$currentDate = $currentDateObject->format("Y-m-d");
方法四:使用PHP内置函数strftime()
$currentDate = strftime("%Y-%m-%d", time());