我有一个具有以下架构的 Postgres 表:
id | name | sdate (timestamp) | edate (timestamp)
---+--------+---------------------+---------------------
1 | test6 | 2013-05-13 01:16:16 | 2013-07-03 10:16:11
2 | test44 | 2012-05-10 10:16:11 | 2013-05-03 00:12:11
3 | test32 | 2013-02-03 00:16:12 | 2013-05-03 00:56:15
4 | test2 | 2013-01-05 08:16:11 | 2014-04-03 10:26:11
6 | test3 | 2013-01-03 00:16:12 | 2013-01-03 04:16:18
我需要返回行
select XXX() is in between sdate and edate
XXX()
在哪里current utc time + 4:30.000
。
在伪代码中:
select count(*)
where ((current utc time + 4:30.000) >= sdate
&& (current utc time + 4:30.000) <= edate)
对于初学者,如何在 Postgres 中获得当前的 UTC 时间 + 4:30.000?