I have a form where the admin enters a date. After that it will create a letter like this.
"You are hereby required to appear before me on the ___ day of _____, 20____. "
How can I make this format when the date entered in database is in YYYY-MM-DD format?
Thank you!
$date = "2011-07-26"; // put your date here <br>
$date = strtotime($date); <br>
$day = date('d', $date); //it will get only the day <br>
$month = date('M', $date); //I'm not sure what you want try 'm' <br>
$year= date('Y', $date); //or 'y'
I hope it helps you
Try this
$date="28-01-2016";//Put Date Here
//convert to database type
$db_date_format=date('Y-m-d',strtotime($date));
it helps you