• support@answerspoint.com

Convert date format yyyy-mm-dd => dd-mm-yyyy

Packers and Movers in Patna

I am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy (but not in SQL); however I don't know how the date function requires a timestamp, and I can't get a timestamp from this string.

How is this possible?



Use Can Use  strtotime() and date():

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

(see strtotime and date docs on the PHP site).

  • answered 5 years ago
  • Community  wiki

Packers and Movers in Patna

Your Answer

    Facebook Share        
  • asked 5 years ago
  • viewed 2254 times
  • active 5 years ago

Best Rated Questions