wordpress echo the date in post

Use the following code to echo the date in a WordPress post:

<?php echo get_the_date(); ?>

Explanation: - The get_the_date() function retrieves the date the current post was published. - The PHP opening tag (<?php) indicates the start of a PHP code block. - The echo statement is used to output the result of get_the_date() to the webpage.