get_post_time
get_post_time ( $format = 'U', $gmt = false, $post = null, $translate = false )
Parameters:- (string) format Optional. Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
- (bool) gmt Optional. Whether to retrieve the GMT time. Default false.
- (int|WP_Post) post Post ID or post object. Default is global `$post` object.
- (bool) translate Whether to translate the time string. Default false.
Returns:- (string|int|false) Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. False on failure.
Defined at: - Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Description
Retrieves the time at which the post was written.