Home >Database >Mysql Tutorial >mysql获得60天前unix时间思路及代码_MySQL

mysql获得60天前unix时间思路及代码_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:051092browse

select UNIX_TIMESTAMP(ADDDATE(NOW(),INTERVAL -60 DAY)) 

首先根据now()获得当前时间

使用adddate()方法获得60天前时间

使用unix_timestamp()方法转换时间类型

Statement:
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