How to add 15 minutes to DATE in Oracle

April 28, 2020 No comments Oracle sysdate minutes QA

1. Introduction

In this short article, we will present a way to add and subtract minutes to an Oracle date column.

2. Add minutes to an Oracle date

To add minutes to an Oracle date column we can simply use + operator like in the following example:

select sysdate, sysdate + (1/1440*15) from dual;
  • sysdate + 1 is exactly one day ahead - 24 hours,

  • / 1440 divide the # of minutes in a day,

  • multiply by 15 to get the 15 minutes ahead.

Query used in the above example will produce the following result (for sysdate = '2019-10-16 23:32:45');

SYSDATE SYSDATE + (1/1440*15)
2019-10-16 23:32:45 2019-10-16 23:47:45

The other method to add minutes to an Oracle date is to use interval command:

select sysdate, sysdate + interval '15' minute from dual;

3. Subtract minutes from Oracle date

To get 15 minutes earlier date use the following query:

select sysdate, sysdate + (1/1440*-15) from dual;

4. Conclusion

In this article, we presented how to add and subtract minutes to the DATE in Oracle. Luckily Oracle provides an easy way to achieve that simply by using mathematic operators like plus '+' and minus '-'.

{{ message }}

{{ 'Comments are closed.' | trans }}