As it turned out Hibernate doesn't convert dates to GMT automatically, it just cuts off time if you use query.setDate()
, so if you pass "2009-01-16 12:13:14" it becomes "2009-01-16 00:00:00".
To take time into consideration you need to use query.setTimestamp("date", dateObj)
instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…