Home > Database > Mysql Tutorial > Mysql 计算时间间隔函数_MySQL

Mysql 计算时间间隔函数_MySQL

WBOY
Release: 2016-06-01 13:07:50
Original
952 people have browsed it

#计算两个时间的间隔

#计算间隔天数

select TIMESTAMPDIFF(day,'2014-06-01',date(now()))

#计算间隔月数

select TIMESTAMPDIFF(month,'2014-01-01',date(now()))

#计算间隔年数

select TIMESTAMPDIFF(year,'2010-01-01',date(now()))
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