I have a Postgres table with the following schema:
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
I need to return the rows with
select XXX() is in between sdate and edate
Where XXX()
is current utc time + 4:30.000
.
In pseudo code:
select count(*)
where ((current utc time + 4:30.000) >= sdate
&& (current utc time + 4:30.000) <= edate)
For starters, how do I get the current utc time + 4:30.000 in Postgres?