Skip to content
Advertisement

How to convert Local_Timestamp into UTC Timestamp?

The Timestamp is the localtime of the DB2 Server. The date was stored in the time zone Europe / Berlin.

I would like to convert the then stored date to UTC. Is there a way to calculate this in DB2 Dialect?

Advertisement

Answer

Check out the TO_UTC_TIMESTAMP scalar function

 values TO_UTC_TIMESTAMP(TIMESTAMP'2019-10-01 00:00:00', 'Europe/Berlin')

Please note the second parameter is case sensitive. There is also a FROM_UTC_TIMESTAMP if needed.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement