'Not able to add time in SQL
I have been learning SQL,and I was trying out this command:
SELECT TO_CHAR (SYSDATE,'HH:MM:SS'),TO_CHAR(SYSDATE+INTERVAL '15' MINUTE,'HH:MM:SS') FROM DUAL;
However the output I am getting is 
I even tried out this command:
SELECT TO_CHAR (SYSDATE,'HH:MM:SS'),TO_CHAR(SYSDATE+15/1440,'HH:MM:SS') FROM DUAL;
Even then I am getting this output:

Can anyone explain why am I not getting the second time as 15 minutes ahead of the current system date?
PS: I am using Oracle LiveSQL.
Solution 1:[1]
As mentioned by Barbaros Özhan in comments
The MM format model is for months. You want the MI format model for minutes.
Additionally, the HHformat model is an abbreviation for HH12 and will show the hours in a 12-hour clock. You want HH24 to use a 24-hour clock.
SELECT TO_CHAR(SYSDATE,'HH24:MI:SS') AS now,
TO_CHAR(SYSDATE+INTERVAL '15' MINUTE,'HH24:MI:SS') AS now_plus_15
FROM DUAL;
Outputs:
NOW NOW_PLUS_15 12:38:13 12:53:13
db<>fiddle here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
