MySQL Forums
Forum List  »  PHP

Re: Echo date in dd-mm--yy format
Posted by: Sean Schaffer
Date: August 18, 2022 08:49AM

Thanks Peter for taking the time to respond, I appreciate it. I apologize, the data is in yyyy-mm-dd format in a DATE column so when I run the query it echos as 2022-08-18. I'd like to just have it echo as 08-18-2022.

So I take it I just use str_to_date() to modify to dd-mm-yyyy but I'm confused as to where I place it in my line of code? Inside the brackets? After $row? It's just not obvious to me.

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

Thanks again for your time and effort.

Options: ReplyQuote

Written By
Re: Echo date in dd-mm--yy format
August 18, 2022 08:49AM

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.