-1

I want to echo a special real time date format using PHP. For example, today we are in 11/09/2016 now.. well, I want to echo 11 septembre 2016.

My code:

$d=strtotime("10:30pm April 15 2014");
echo "Created date is " . date("Y-m-d h:i:sa", $d);

Any ideas?

pebly
  • 11
  • 6

1 Answers1

0

This may be a work-around. There may be some other correct methods.

$months = array("January","February","March","April","May","June","July","August","September","October","November","December");
$d=strtotime("10:30pm April 15 2014");
$ex_date = explode("-",date("Y-m-d h:i:sa", $d));
$month = intval($ex_date[1]);
$date = $ex_date[0]."-".$months[$month]."-".$ex_date[2];
echo "Created date is " . $date;
Nandan Bhat
  • 1,573
  • 2
  • 9
  • 21