MAO
MAO

Reputation: 81

How to retrieve only the date from a Column that the Datatype is TIMESTAMP

I have a column in my database which the datetype is TimeStamp, but I want the only date part of this column not date and time, for example if the time stamp is (2016-02-06 21:01:27) so I only want the (2016-02-06), So I need your help

Upvotes: 1

Views: 25

Answers (1)

Nir Levy
Nir Levy

Reputation: 12953

you can use date() function

mysql> SELECT DATE('2003-12-31 01:02:03');
        -> '2003-12-31'

Upvotes: 1

Related Questions