SUPER EASY php mysql date display

how do you take a date variable from a mysql database and display it in the date format you choose?
Who is Participating?
hernst42Connect With a Mentor Commented:
use strtotime and date

$formated_date = date('M,d,Y', strtotime(mysql_result($result,$i,"db_date")));

See and

how does the date from the db look?
Ali KayahanFull Stack DeveloperCommented:
$date = date("M,d,Y",$db_date) ;
Ali KayahanFull Stack DeveloperCommented:
It will work if you populate your field with time()
newbe101Author Commented:
Thank you again, hernst42 !
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.