如何在GQL中查询过去6小时(日期时间)的所有条目? [英] How to query all entries from past 6 hours ( datetime) in GQL?

查看:178
本文介绍了如何在GQL中查询过去6小时(日期时间)的所有条目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google App Engine中有一个带日期字段的简单表格。我想要查询所有的行,其中的值是现在和6小时之前的值。

I have a simple table in Google App Engine with a date field. I want to query all the rows with the date field valued between now and 6 hours ago. How do I form this query?

推荐答案

SELECT * FROM simpletable
WHERE datefield < DATETIME(year, month, day, hour, minute, second)

计算那些年,月, ; c,在您的应用程序代码中。

computing those year, month, &c, in your application code.

这篇关于如何在GQL中查询过去6小时(日期时间)的所有条目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆