lundi 2 mars 2015

How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields?


I am modifying someone's Wordpress theme and they have a section for upcoming tour dates. The page for inputting was made with Advanced Custom fields plugin and uses a date picker widget that stores the date as an 8 digit number backwards in the database such as


20140508


and I would like it to display in ANY normal format like


08/05/2014 or even better Aug. 05, 2014


I'm not much of a coder but I can see that the template file just displays it like this:



$start_date = get_sub_field('appearance_start_date');

$echo .= '<p>' . $start_date . '</p>';


Is there some code I can add to the template file or a pre-made function I could use to display the date in a normal format?





Aucun commentaire:

Enregistrer un commentaire