Link to home
Create AccountLog in
Avatar of gingera
gingera

asked on

PHP MYSQL: How to convert yyyy-mm-dd to dd/mm/yyyy?

Hello,

How do I convert $x from "yyyy-mm-dd" to "dd/mm/yyyy" in a PHP script?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of gingera
gingera

ASKER

THANKS!
Avatar of gingera

ASKER

I have to clarify Roonaan's 1st suggestion should read:

$newDate = date('d/m/Y', strtotime('$x));

not

$newDate = date('dd/mm/YYYY', strtotime('$x));