zoukankan      html  css  js  c++  java
  • MySQL比较时间(datetime)大小

    获取时间返回的秒数:strtotime('2019-05-10 00:00:00')

    遇到一个业务功能需要将当前时间与数据库中的会议开始、结束时间进行比较,记录一下,方便下次用。

    用unix_timestamp函数,将字符型的时间,转成unix时间戳。

    select meeting_id,meeting_name,start_time,end_time from meeting_data
    where meeting_id REGEXP '[0-9]{4}0001'
    and unix_timestamp(start_time) < unix_timestamp(NOW())
    and unix_timestamp(end_time) > unix_timestamp(NOW());
    ------------------------------------------------------------------------------------------------

    原文:https://blog.csdn.net/qq_27124771/article/details/81219550

  • 相关阅读:
    每周总结03
    Servlet2
    每周总结02
    周总结4
    河北省重大需求征集系统每日进度6
    周总结3
    hadoop命令
    复习uml
    周总结2
    河北省重大需求征集系统每日进度5
  • 原文地址:https://www.cnblogs.com/showcase/p/10843147.html
Copyright © 2011-2022 走看看