-3

Hi all i want to convert mdy format of date to ymd format

$todate = '03-31-2016;

I am using this code to convert it

$todate = date("Y-m-d", strtotime($todate));

This code gives me output

1969-12-31

so whats the right way to do it?

Thanks

Sanjay Rathod
  • 1,033
  • 5
  • 18
  • 44

1 Answers1

1

Try this code

$date = '03-31-2016;
$todate = date("Y-m-d", strtotime($date));
Arsal Ali
  • 978
  • 3
  • 20
  • 54