Languages: English • 日本語 (Add your language)
Returns the time of the current post for use in PHP. It does not display the time. To display the time of a post, use the_time(). This tag can be used within The Loop.
<?php get_post_time( $d, $gmt, $post, $translate ); ?>
$post
objectThis function is used internally by other functions, such as get_the_time().
The proper way to get the GMT timestamp for a post is by setting the $gmt
option to true
:
<?php $gmt_timestamp = get_post_time('U', true); ?>
get_calendar(), get_day_link(), get_month_link(), get_the_date(), get_the_time(), get_year_link(), single_month_title(), the_date(), the_date_xml(), the_modified_date(), get_the_modified_date(), the_modified_time(), get_the_modified_time(), the_time()