Sometimes on a specific project, you have requirement to also display last modified date of pages and posts along with published date. So here is a code snippet to display both in your WordPress.
Posted on <?php the_time( 'F jS, Y' ); ?>
<?php
// display last modified date
$modified_time = get_the_time( 'U' );
$new_modified_time = get_the_modified_time( 'U' );
if ( $new_modified_time != $modified_time ) {
echo " and last modified on ";
the_modified_time( 'F jS, Y' );
echo ".";
}
?>