I've used custom field on my event called date. I want to display this date as: MAY 23, 2017. But it's displaying as: 20170523. I've used this code.
<?php the_field( 'date' ); ?>
I've used custom field on my event called date. I want to display this date as: MAY 23, 2017. But it's displaying as: 20170523. I've used this code.
<?php the_field( 'date' ); ?>
Are you using Advanced Custom Fields PRO? If yes, then you can try this:
<?php
$time = strtotime( get_field( 'date' ) );
$date = date( 'F d, Y', $time );
echo $date;
?>
More native way for Advanced Custom Fields PRO would be the following:
<?php
$date = get_field( 'date', false, false );
$date = new DateTime( $date );
echo $date->format('F d, Y');
?>