DB2 timestampdiff function returning unexpected results
问题 I'm using the following syntax TIMESTAMPDIFF(2, CHAR(CREATED - TIMESTAMP('1970-01-01 00:00:00')) where CREATED is of type TIMESTAMP and the database is DB2. The intension is to get the timestamp converted to millis from epoch. If there is a better function that would be more helpful. Sample data: For 2011-10-04 13:54:50 returned value is 1316613290 but actual value should be 1317732890 (got from http://www.epochconverter.com) Query to run SELECT TIMESTAMPDIFF(2, CHAR(TIMESTAMP('2011-10-04 13