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

关于日期比较。解决方案

WBOY
Release: 2016-06-13 10:37:29
Original
817 people have browsed it

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

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

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

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