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

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

WBOY
WBOYOriginal
2016-06-07 16:28:47916browse

select UNIX_TIMESTAMP(ADDDATE(NOW(),INTERVAL -60 DAY)) 首先根据now()获得当前时间 使用adddate()方法获得60天前时间 使用unix_timestamp()方法转换时间类型

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