0

I need to convert string to date in below format, but I am not getting any result.

Below is the code, which doesn't print any date after converting.

$dt="2015/09/10 11:03:48";
$tmpDate = date_create_from_format('Y/m/d H:i:s', $dt);
echo $dt." = " . date("Y/m/d H:i:s", $tmpDate)."<br>"; // just to make sure the conversion is correct
CodeDezk
  • 1,230
  • 1
  • 12
  • 40

0 Answers0