get_the_time

SummerySummery

Retrieve the time at which the post was written.

Syntax

get_the_time( string $format = '', int|WP_Post $post = null )

ParametersParameters

$format

(string) (Optional) Format to use for retrieving the time the post was written. Either 'G', 'U', or PHP date format defaults to the value specified in the time_format option.

Default value: ''

$post

(int|WP_Post) (Optional) WP_Post object or ID. Default is global $post object.

Default value: null

ReturnReturn

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

SourceSource

File: wp-includes/general-template.php


			

ChangelogChangelog

Changelog
Version Description
1.5.0 Introduced.
Scroll to Top