Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a way I can format mySQL dates on retrieval rather than by using php functions?

0
Posted

Is there a way I can format mySQL dates on retrieval rather than by using php functions?

0

It is much easier to use the mysql DATE_FORMAT() function to format your dates when retrieving directly from the data base. You do not have to convert to a UNIX time stamp and all that other stuff. Your select statement should look something like: $date_format_long=”%d:%m:%y at %T”; $query=”select DATE_FORMAT(date_field, ‘$date_format_long’ ) as fmt_date from your_table”; RTM at http://www.mysql.

0

It is much easier to use the mysql DATE_FORMAT() function to format your dates when retrieving directly from the data base. You do not have to convert to a UNIX time stamp and all that other stuff.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123