jOOQ “EXTRACT(EPOCH FROM [field])” workaround?

前端 未结 3 1030
春和景丽
春和景丽 2021-01-13 13:01

There\'s syntax that allows transforming a Timestamp into various date parts, including the unix epoch. This works as follows (in lastest PostgreSQL at least):



        
3条回答
  •  爱一瞬间的悲伤
    2021-01-13 13:28

    Just wanted to add there's org.jooq.impl.DSL.timestampDiff(...) in case you needed the epoch to calculate difference between two timestamps in milliseconds.

提交回复
热议问题