从postgres日期和postgres时间获取Postgres时间戳值

时间:2018-08-01 09:56:57

标签: java postgresql

我有一个postgres日期和posgres时间栏。是否有任何postgres函数可从这些列获取postgres时间戳。该时间戳值用于与Java sql时间戳对象进行比较。

1 个答案:

答案 0 :(得分:1)

您可以使用+运算符对两列进行求和。当您将日期时间类型相加时,将得到一个时间戳作为答案。

看第一张桌子的第三行。 https://www.postgresql.org/docs/current/functions-datetime.html

相关问题