0

i store a month-year data as m-Y date format, and my problem is i cant show the data with date M-Y format because strtotime only work if date formated in Y-m.

this is what i've done but not work : my data : $data->date = '11-2020';

date('M-Y',strtotime($data->date)) //result become Jan-1970

any ideas?

MUH. ISA S
  • 23
  • 4

1 Answers1

0

Try this one,It may work

$convertToDate=date('d-m-Y',strtotime($data->date));
$expectedOutput=date('M-Y',strtotime($convertToDate));
Merin Ovelil
  • 367
  • 2
  • 9