wordpress get post date and time code example
Example 1: wordpress echo the date in post
$post_date = get_the_date( 'D M j' ); echo $post_date;
Example 2: wordpress get post time
// Retrieve the time at which the post was written.
get_the_time( string $format = '', int|WP_Post $post = null )