Java bro

Java tutorial

Sql queries

Add time to sql date

In this article we wre going to learn how to add time to sql date.

Adding 3 hours:

SELECT TO_CHAR (SYSDATE + 3/24 , ‘MM-DD-YYYY HH24:MI:SS’) AS CUR_TIME FROM DUAL;

Adding 3 minutes:

SELECT TO_CHAR (SYSDATE + 3/1440 , ‘MM-DD-YYYY HH24:MI:SS’) AS CUR_TIME FROM DUAL;

Adding 3 seconds:

SELECT TO_CHAR (SYSDATE + 3/86400 , ‘MM-DD-YYYY HH24:MI:SS’) AS CUR_TIME FROM DUAL;

Comments are Closed

Theme by Anders Norén