MySQL Forums
Forum List  »  PHP

Echo date in dd-mm--yy format
Posted by: Sean Schaffer
Date: August 17, 2022 10:21AM

I searched for a similar question in this forum but didn't see it. I apologize if asked previously. I am echoing into a table a date that is in "dd-MM-yyyy hh:mm:ss" format from a column called "date_added" in my db, but I need to echo it in dd-MM-yy.

I found some info on maybe using strtotime() to format but I'm confused as to where to put the formatting info. The piece of code that echos the date is below.

echo "<td>" . $row["date_added"]. "</td>

Any help is appreciated.

Options: ReplyQuote

Written By
Echo date in dd-mm--yy format
August 17, 2022 10:21AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.