Home > Database > Mysql Tutorial > body text

Mysql计算时间间隔函数_MySQL

WBOY
Release: 2016-06-01 13:07:26
Original
954 people have browsed it

bitsCN.com

#计算两个时间的间隔

#计算间隔天数

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

#计算间隔月数

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

#计算间隔年数

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