获取时间返回的秒数: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

相关文章:

  • 2021-05-22
  • 2021-10-25
  • 2021-12-03
  • 2021-12-20
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-12-03
  • 2021-10-21
相关资源
相似解决方案