PHP头条
热点:

php 打印7天前的时间,


方法1

$date = date('Y-m-d', strtotime('-7 days'));

date() 函数声明

string date ( string $format [, int $timestamp ] )

返回将整数 timestamp 按照给定的格式字串而产生的字符串。如果没有给出时间戳则使用本地当前时间。换句话说,timestamp 是可选的,默认值为 time()。

strtotime

www.phpzy.comtrue/php/23902.htmlTechArticlephp 打印7天前的时间, 方法1 $ date = date ( 'Y-m-d' , strtotime( '-7 days' )); date() 函数声明 string date ( string $format [, int $timestamp ] ) 返回将整数 timestamp 按照给定的格式字串而产生的字符串。如果...

相关文章

    暂无相关文章

PHP之友评论

今天推荐