Priya
Priya

Reputation: 1216

Get a Postgres timestamp value from postgres date and postgres time

I have a postgres date and posgres time column. Is there any postgres function to get postgres timestamp from these columns. This timestamp value is used to compare with the Java sql timestamp object.

Upvotes: 0

Views: 260

Answers (1)

Filipe Mendes
Filipe Mendes

Reputation: 185

You can just sum the two columns using + operator. When you sum a date with a time type, you'll get a timestamp as the answer.

Look at the first table's third line. https://www.postgresql.org/docs/current/functions-datetime.html

Upvotes: 1

Related Questions