DB2 Format Current Time: TIMESTAMP_FORMAT Guide

In DB2, you can use the following function to retrieve the current time and format it:

SELECT TIMESTAMP_FORMAT(CURRENT TIMESTAMP, 'YYYY-MM-DD HH:MI:SS') AS formatted_time FROM SYSIBM.SYSDUMMY1;

This SQL statement will return the current time and format it according to ‘YYYY-MM-DD HH:MI:SS’. You can adjust the formatting as needed.

bannerAds