How do I convert unix timestamp value like 1348560343598 to H2 Timestamp?
1348560343598
Timestamp
One of my tables contains these unix timestamps in a BIGINT
BIGINT
Ok, using the following formula works:
select DATEADD('SECOND', 1348560343, DATE '1970-01-01')
Just remember to divide the timestamp with 1000. Using 'MILLISECOND' doesn't work, you will get Numeric value out of range.
'MILLISECOND'
Numeric value out of range