I have this date format in my db
19th April 2013
I want to convert it to
2013-04-19
I have used if,else conditions , BUt it becomes too long and complicated .Are there any built in functions ??
Use PHP's date function
date("Y-m-d",strtotime("19th April 2013"));
yes below code to change date format
date("Y-m-d",strtotime("19th April 2013")); to get as 2013-04-19
and for second one
date("Y/m/d",strtotime("17th April 2013")); to get as 2013-04-17
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With