
当前21点,却搜出了上午11点的数据,10个小时,将SQL语句复制到数据库中执行:

也是一样的,那么问题可能在datetime('now')上了,单独执行看下:

果然,datetime('now')是UTC时间,跟北京时间差了八个小时,改下SQL语句,问题解决:
[i]Select id, price, create_time
FROM tablename
Where create_time >= datetime('now', [color=red]'localtime',[/color] '-2 hours')
orDER BY create_time ASC[/i]
评论(0)
暂无评论。