I am struggling to get the date to output (at all!)
I have the following and I want the date to be output like 26th May 2014
<p><?php the_field('description'); ?></p>
<?php $date = DateTime::createFromFormat('Ymd', get_field('when')); ?>
<h2><?php echo $date->format('d-m-Y'); ?></p>
All the above is inside a wordpress loop
Even if I move the variable declaration outside the loop, it still doesn;t work.
thanks
This will echo:
This will return the value to the
$date
var: