It's unclear what you are asking for. There exist following datatypes: date
, time
, datetime
and timestamp
. And there's UNIX_TIMESTAMP
, which is the seconds since 1970-01-01, but I don't think that's what you're after.
I suggest you read this.
The DATETIME type is used for values that contain both date and time
parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD
HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to
'9999-12-31 23:59:59'.
The TIMESTAMP data type is used for values that contain both date and
time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to
'2038-01-19 03:14:07' UTC.
When you want to convert your column date
do:
ALTER TABLE yourTable MODIFY COLUMN yourDateColumn TIMESTAMP;