Hi.
My site is located in a hosting which php version is 5.3.29 and apparently I should use the code below , but it shows 1970 1 january , I would be thankful to help me if I should use another code…
<?php
$date = get_field(‘exhibitionstartdate’);
$y = substr($date, 0, 4);
$m = substr($date, 4, 2);
$d = substr($date, 6, 2);
$time = strtotime(“{$d}-{$m}-{$y}”);
echo date(‘F n Y’, $time);
?>
That code is assuming your get_field('exhibitionstartdate')
is in the format yyyymmdd. If you do:
echo get_field('exhibitionstartdate');
What is the output?