How to Get the Date From a MySQL Timestamp
The MySQL DATE function returns the date from a table field that contains either date or date and time information. The function takes one expression. This may come in the form of a table field or a string containing a date. You may want to use the Date function to find out what rows in your table were submitted on a certain day, or to organize your search results by the date itself.
Instructions
-
-
1
Log in to MySQL and open the query tool.
-
2
Enter the following query:
SELECT DATE(date_field) FROM table_name;
Substitute "date_field" with the name of the field that holds dates in your table, and substitute "table_name" with the name of the table.
-
-
3
Execute the query. MySQL returns the dates for each row in the table.
-
1