get_post_time ( $format = 'U', $gmt = false, $post = null, $translate = false )

  • (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.
  • (string|int|false) Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. False on failure.
Defined at:


Retrieves the time at which the post was written.

Related Functions

get_post_datetime, get_post_type, get_post_meta, get_post_timestamp, get_post_types

Top Google Results

User discussions

wpseek mobile