Jump to content

Date Formatting


Dracolas

Recommended Posts

look in the MySQL manual at the DATE_FORMAT() function, which does exactly what you're asking. a script with that few lines is not a problem to paste here, and is easier to read here than having to jump to another link. please post in the forum for small scripts like this in future.

Link to comment
https://forums.phpfreaks.com/topic/190264-date-formatting/#findComment-1003811
Share on other sites

ok i understand what your saying and i get the use of Date_format(), but when i go to use it on my site with date being $date which is grabbed from the database it gives me error:

Warning: date_format() expects parameter 1 to be DateTime, string given in /home/a1237238/public_html/clan/home.php on line 20

what can i do to use this with the $date function... please assist

Link to comment
https://forums.phpfreaks.com/topic/190264-date-formatting/#findComment-1003882
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.