0

I am getting data in my php variable from database:

var_dump("The schedule is: ".$my_Schedule);

I am getting this output:

string(37) "Reviews created : 2019-10-19 03:47:57"

Now I want to use this data to show something like:

// My Desired Result
Oct 01, 2019

I don't want time here.

I am doing it like this:

<p><?=date('Y-m-d',$my_Schedule);?></p>

This is not working for me.

Kindly suggest what I am doing wrong.

Any idea or suggestion would be helpful.

Thank You.

Sarah
  • 39
  • 1
  • 8

2 Answers2

0

Please use following code

echo date('M d,Y',strtotime('2019-10-19 03:47:57'));
Mahesh Bhatnagar
  • 1,042
  • 1
  • 7
  • 8
0

You can use like this:

$date = date('M d, Y', strtotime('2019-10-19 03:47:57'));
echo $date;
// output Oct 19, 2019
akshaypjoshi
  • 1,245
  • 1
  • 15
  • 24