Home > Database > Mysql Tutorial > 格式化时间戳为日期格式 如,'%Y-%m-%d'类型

格式化时间戳为日期格式 如,'%Y-%m-%d'类型

WBOY
Release: 2016-06-07 14:57:22
Original
3924 people have browsed it

FROM_UNIXTIME(时间戳,格式类型)格式化时间戳为日期格式如,%Y-%m-%d类型 UNIX_TIMESTAMP(日期类型)格式化日期为时间戳格式 MySQL SELECT id, title,createdate,FROM_UNIXTIME(UNIX_TIMESTAMP(createdate),'%Y-%m-%d') AS createdate

FROM_UNIXTIME(时间戳,格式类型)   格式化时间戳为日期格式 如,'%Y-%m-%d'类型
UNIX_TIMESTAMP(日期类型)  格式化日期为时间戳格式
MySQL
SELECT id, title,createdate,FROM_UNIXTIME(UNIX_TIMESTAMP(createdate),'%Y-%m-%d') AS createdate
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template