You can achieve that using DATE_FORMAT() (click the link for more other formats)
SELECT DATE_FORMAT(colName, '%Y-%m-%d') DATEONLY,
DATE_FORMAT(colName,'%H:%i:%s') TIMEONLY
SQLFiddle Demo
More Related Contents:
- How to convert ISO8601 to Date format in php
- PHP DateTime supported formats
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE `id` [closed]
- Using PHP data in MySQL [closed]
- Checking the availability of rooms
- How to properly set up a PDO connection
- Commands out of sync; you can’t run this command now
- SELECT COUNT(*) AS count – How to use this count
- Get table column names in MySQL?
- How to resolve ambiguous column names when retrieving results?
- Loading .sql files from within PHP
- selecting unique values from a column
- Use bound parameter multiple times
- Object of class DateTime could not be converted to string
- MySQL “NOT IN” query 3 tables
- Create a dynamic mysql query using php variables
- PHP: multiple SQL queries in one mysql_query statement
- Why does this return Resource id #2? [duplicate]
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- Date in a URL dd/mm/yyyy
- How to generate unique id in MySQL?
- MySql PHP select count of distinct values from comma separated data (tags)
- How to SELECT DEFAULT value of a field
- adding 30 minutes to datetime php/mysql
- How to check if a value already exists to avoid duplicates?
- UNION syntax in Cakephp
- MYSQL select a piece of a string and order by that piece
- How do i search from serialize field in mysql database?
- PHP/MySQL Pagination
- Limit pagination page number