Q:

Replace returned text with the date

I have a field that returns text in this format e.g. 150426 where 15 is the year 04 is the month and 26 is the day.
I'd like to turn that into the day, month and year.
<?php $value = get_field('catalogue'); sscanf('%02d%02d%02d', $year, $month, $day); ?><?php print $value; ?>

I guess it needs to turn the returned text into a date to begin with?

A:

$value should be the first parameter of sscanf
$value = '150426';
sscanf($value, '%02d%02d%02d', $year, $month, $day);

echo "$year $month $day";

