Displays dates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
robaiken
Forum Newbie
Posts: 4
Joined: Wed Jun 17, 2009 5:44 am

Displays dates

Post by robaiken »

hi i was wondering how i can display a list of items from mysql database for the current month. my date formate in the database is 0000-00-00.

Thanks
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Displays dates

Post by mattpointblank »

Code: Select all

 
echo date("y-m-d g:i:a", strtotime($date));
// assumes $date contains the date row from your database
 
Use the syntax here to customise the formatting: http://uk2.php.net/manual/en/function.date.php
Post Reply