Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a built-in php function to grab a datetime and output just the date

Status
Not open for further replies.

webslinga

Programmer
Jun 20, 2006
55
US
hey all,
I would like to know if there is a php built-in function that grabs a datetime field from a MySQL table and outputs JUST the date { i.e - 2006-07-30 } without the time value. Thanks in advance.
 
A builtin function to do that one specific thing? No.

But PHP has functions to connect to a MySQL server, send a query and deal with the returned data. See

As far as taking a MySQL datetime field and returning just the date, you can either use PHP's date() and strtotime() functions or use MySQL's builtin date() function.



Want the best answers? Ask the best questions! TANSTAAFL!
 
to elaborate on sleipnir214:

SELECT date(your_date-time-field) FROM ....

K

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks guys. I worked it out with the date helper functions in the symfony framework. Thanks again for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top