Skip to main content

php date PHP date_format(): How to format will giving wrong date from string value

I have a bit of php codeI have a bit of PHP code:

$exd = date_create('01 Dec, 2015'); $exd = date_format($exd, 'Y-m-d'); echo $exd; 

whichWhich is used for formatting the date. The expected output willwould be 2015-12-01 but it returns 2016-12-01. Where i'mWhat am i missing?

php date format will giving wrong date

I have a bit of php code

$exd = date_create('01 Dec, 2015'); $exd = date_format($exd, 'Y-m-d'); echo $exd; 

which is used for formatting the date. The expected output will be 2015-12-01 but it returns 2016-12-01. Where i'm missing?

PHP date_format(): How to format date from string value

I have a bit of PHP code:

$exd = date_create('01 Dec, 2015'); $exd = date_format($exd, 'Y-m-d'); echo $exd; 

Which is used for formatting the date. The expected output would be 2015-12-01 but it returns 2016-12-01. What am i missing?

Source Link
mpsbhat
  • 2.8k
  • 12
  • 52
  • 107

php date format will giving wrong date

I have a bit of php code

$exd = date_create('01 Dec, 2015'); $exd = date_format($exd, 'Y-m-d'); echo $exd; 

which is used for formatting the date. The expected output will be 2015-12-01 but it returns 2016-12-01. Where i'm missing?