WPDev.one
Core Function
View Source on Trac ↗

get_the_time()

get_the_time( mixed $format = '', mixed $post = null )

Retrieves the time of the post.

Parameters 2 required

Name / Type Description
string

$format Optional. Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format. Defaults to the 'time_format' option.

Required
(int

| WP_Post) $post Post ID or post object. Default is global `$post` object.

Required

Return Value

((string)
(string | int | false) Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. False on failure.

Function Information

Since Version
1.5.0
Source File
wp-includes/general-template.php
Advertisement