0

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?

1
  • A date is very different in nature from a timestamp, btw. Commented Apr 25, 2013 at 1:46

1 Answer 1

3

Remove TimeStamp keyword

SELECT LOCALTIMESTAMP(0) + interval '23 hours'

or use

SELECT now() + interval '23 hours'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.