mysql method to convert timestamp into date: use the function [FROM_UNIXTIME()], the code is [select FROM_UNIXTIME(1429063399, & # 39; %Y year %m month %d day & # 39;) 】.
Mysql converts timestamp to date:
1. Convert timestamp to date
Function: FROM_UNIXTIME()
select FROM_UNIXTIME(1429063399,'%YYear%mMonth%dDay' ;)
The result is: April 15, 2015
2. Convert the date to a timestamp, which is exactly the opposite of FROM_UNIXTIME
Function: UNIX_TIMESTAMP()
select UNIX_TIMESTAMP('2015-04-15')
The result is: 1429027200
Related free learning recommendation: mysql database (video)
The above is the detailed content of how mysql converts timestamps into dates. For more information, please pay attention to other related articles on 1024programmer.com !