如何从以下查询的where子句中删除日期函数?

时间:2015-07-23 12:08:34

标签: mysql

我正在使用此查询在我自己的时区中从我的用户表中查找一些记录。请有人帮帮忙吗?这是我在MySql DB上使用的查询:

select *
from user
where date(convert_tz(now(), '+00:00', '+05:30')) > date(convert_tz(start_date, '+00:00', '+05:30')) AND
      now() < end_date; 

1 个答案:

答案 0 :(得分:-1)

在声明日期时,请尝试使用datestamp或timestamp作为数据类型。使用此功能可能有助于您的代码获取您在计算机中使用的日期和时间格式。

相关问题