Home  >  Article  >  Database  >  How to convert timestamp to date and time in MySQL

How to convert timestamp to date and time in MySQL

PHPz
PHPzforward
2023-05-29 12:43:26893browse

FROM_UNIXTIME(unix_timestamp,format): Convert timestamp into date and time

SELECT FROM_UNIXTIME(1452959999) 
SELECT FROM_UNIXTIME(1452959999,'%Y-%m-%d %H:%i:%s')
-> 2016-01-16 23:59:59
-> 2016-01-16 23:59:59

The above is the detailed content of How to convert timestamp to date and time in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete