Date Formating

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
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

Date Formating

Post by gurjit »

I have a datetime field type in a table which stores the date like this

2003-07-23 16:38

i'm running a query to search a date range but i cannot get the query to just look at the date part in the WHERE statement

WHERE f_date_closed = '$today_search'

the f_date_closed has date stored like 2003-07-23 16:38 but i am searching for 2003-07-23 in the today_search parameter.

How do you only pull the date in the f_date_closed field and ignore the time?
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

if you are using mysql check the DATE_FORMAT function (http://www.mysql.com/doc/en/Date_and_ti ... tions.html)
Post Reply