Reputation: 42753
I want to add an interval of 23 hours to the current date and time in PostgreSQL. The query should look something like the following:
SELECT timestamp LOCALTIMESTAMP(0) + interval '23 hours';
For some reason, the preceding statement returns an error. What could be wrong here and why is it not working?
Upvotes: 0
Views: 1663
Reputation: 17839
Remove TimeStamp keyword
SELECT LOCALTIMESTAMP(0) + interval '23 hours'
or use
SELECT now() + interval '23 hours'
Upvotes: 3