0

I have a date as follows in the DB: 14/6/2015 00:00:00

I would like to change this to Sunday, 14th June 2015

I tried the following but no luck. Any advice?

$dateStart = get_post_meta( get_the_ID(), 'startdate' , true); // 14/6/2015 00:00:00
$dateStart = date('l, d F Y', strtotime($dateStart));
$dateStart = get_post_meta( get_the_ID(), 'startdate' , true);
$dateStart = DateTime::createFromFormat('d/m/Y h:i:s', $dateStart);
$dateStart = $dateStart->format('m/d/Y');
$dateStart = date('l, d F Y', strtotime($dateStart));

I have tried other threads such as Convert one date format into another in PHP and followed what they have said but it just doesn't work for me, unless I am missing something very obvious

Community
  • 1
  • 1
pee2pee
  • 3,619
  • 7
  • 52
  • 133

0 Answers0