Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
get_post_time() - 检索撰写文章的时间 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_post_time()

get_post_time( string $format = 'U', bool $gmt = false, int|WP_Post $post = null, bool $translate = false )

检索撰写文章的时间


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "c662a3ca6b84e8f01cc3765430bbe052" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "fa7798d2e83d76c537dd953794f65417" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

postmore...

timemore...


参数

$format

(string) (可选) 用于检索文章撰写时间的格式。接受“G”、“U”或PHP日期格式。

默认值: 'U'

$gmt

(bool) (可选) 是否检索GMT时间。

默认值: false

$post

(int|WP_Post) (可选) WP_Post对象或ID。默认值为全局$post对象。

默认值: null

$translate

(bool) (可选) 是否转换时间字符串。

默认值: false


返回

(string|int|false) 如果$format是“U”或“G”,则为格式化的日期字符串或Unix时间戳。失败时为False。



源码

查看源码 官方文档


更新日志

版本描述
2.0.0开始引入

Warning: Undefined variable $o in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference.php on line 194