-5

I have a difficulties regarding converting date into different format

The initial date format is 09/17/2014 which is, mm/dd/YYYY

I want to convert this into a new variable that shows Wednesday, September 17, 2014

How do i implement this?

thanks a bunch

marmar
  • 113
  • 1
  • 1
  • 9
  • 4
    see this http://php.net/manual/en/function.date.php – StaticVariable Sep 25 '14 at 04:07
  • 1
    check [The DateTime class](http://php.net/manual/en/class.datetime.php) and [DateTime::createFromFormat](http://php.net/manual/en/datetime.createfromformat.php) – bansi Sep 25 '14 at 04:15

2 Answers2

3

Try with the following code using DateTime:

$dt = new DateTime('09/17/2014');
echo $dt->format('l, F d, Y');

Or use strtotime

echo date('l, F d, Y', strtotime("09/17/2014"));
Jenz
  • 8,280
  • 7
  • 44
  • 77
0

Use strtotime.

echo date('l, F d, Y', strtotime("09/17/2014"));

Refer http://in2.php.net/manual/en/function.strtotime.php

Dinoop V P
  • 641
  • 7
  • 14