Tag: timestamp with timezone

使用BETWEEN时间戳的SQL查询的意外结果

我创建了一个小测试应用程序来追踪我在Heroku上使用Postgres时遇到的问题: http : //snippi.com/s/xd511rf 正如您在第49行中看到的,我想要检索今天创建的所有条目。 这将是我使用Ruby Gem DataMapper测试数据的前两项。 当我在笔记本上运行这个应用程序(Ubuntu 12.10,HP,Ruby 1.9.3)时,我得到了这个结果,这是正确的: [ { “id”: 1, “text”: “Working on some awsomenewss”, “category”: 0, “starttime”: “2013-03-21T15:56:00+01:00”, “endtime”: “2013-03-21T18:26:00+01:00”, “creation”: “2013-03-21T16:15:21+01:00” }, { “id”: 2, “text”: “facebooking”, “category”: 0, “starttime”: “2013-03-21T20:48:00+01:00”, “endtime”: “2013-03-21T22:26:00+01:00”, “creation”: “2013-03-21T16:15:21+01:00” } ] 在我的调试控制台中,将记录此SQL查询: SELECT “id”, “text”, “category”, “starttime”, “endtime”, “creation” FROM “entries” WHERE […]