How to retrieve the date on which the post was published?

How to retrieve the date on which the post was published?

Trainee Asked on March 4, 2017 in WORDPRESS.
Add Comment
1 Answer(s)

<?php $post_date = get_the_date( $format, $post_id ); ?>

 


{i}$format (string) (optional)
 PHP date format.    

{ii}$post (integer) (optional)
The ID of the post you'd like to fetch.
Team Leader Answered on March 9, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.