-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,083
  • 5
  • 18
  • 45

1 Answers1

1

Try this code

$date = '03-31-2016;
$todate = date("Y-m-d", strtotime($date));
Muhammad Arif
  • 1,014
  • 3
  • 22
  • 56