Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.