DB2 Getting the current database server timestamp

September 25, 2012 in Database

Sometimes, you may need to get the current stamp of the database server if you need for example to calculate the difference between the entry creation time and the current time.
In order to get the current database server timestamp in DB2, you can get it by querying the sysdummy1 table in the sysibm schema as follows:

SELECT CURRENT TIMESTAMP AS CURRENT_SERVER_TIME FROM sysibm.sysdummy1

Leave a reply

Your email address will not be published. Required fields are marked *

353,708 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by sweet Captcha