-4

Possible Duplicate:
PHP: convert date format yyyy-mm-dd => dd-mm-yyyy [NOT IN SQL]

Right now I have DATE stored in mysql as : YY-MM-DD. EX: 2011-12-22.

How can I convert using strtotime to MM-DD-YY in php?

Community
  • 1
  • 1
re1man
  • 2,337
  • 11
  • 38
  • 54
  • check it out at http://stackoverflow.com/questions/2487921/php-convert-date-format-yyyy-mm-dd-dd-mm-yyyy-not-in-sql –  Dec 15 '11 at 06:37

1 Answers1

4
$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));

or use the following link for the similar question Convert date format yyyy-mm-dd => dd-mm-yyyy

Community
  • 1
  • 1
Nishant
  • 3,614
  • 1
  • 20
  • 26