2

Given that the date is requested from another page and is redirected to the current page: The previous page passed the value

wdate_from = '2016-06-03';
$date_from = $_REQUEST['wdate_from'];

How would you convert it to string such that it would result to

June 3, 2016
Nay
  • 27
  • 7

2 Answers2

2

This will get the job done!

$date=date_create($date_from);
echo date_format($date,"F d, Y");
DBA
  • 333
  • 2
  • 7
0

If you know Month and Day part you can use mktime() function to get time. Using the $time to date('M d, Y, $time) to output desired result.

Or You can just use strtotime function directly.

Something like this.

echo date('M d, Y, strtotime($date_from));
J A
  • 1,776
  • 1
  • 12
  • 13