Home  >  Article  >  Backend Development  >  关于日期比较。解决方案

关于日期比较。解决方案

WBOY
WBOYOriginal
2016-06-13 10:37:29778browse

关于日期比较。。。
我想从数据库字段中取出日期 类型为date,然后取得当前日期,进行比较,如果当前日期大于数据库中的日期返回 真 否则返回假  

  自己从网上找了些,发现不行。。 求助。。。

------解决方案--------------------

PHP code
if( (strtotime($data['date']) - time() ) > 0)    return true;else    return false;<div class="clear">
                 
              
              
        
            </div>
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