TRUNC in oracle leaves minutes I have a doubt with the use of TRUNC function in Oracle. As read in the documentation:


  The TRUNC (date) function returns date with the time portion of the day truncated to the unit specified by the format model fmt


I tried this code on my Oracle client:

SELECT
    TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH:MM:SS AM') "Today's Date and Time"
from DUAL;


But all what I get is this: 10/26/2017 12:10:00 AM

It isn't supposed to be 10/26/2017 00:00:00 AM?

By the way, the SYSDATE is this: 10/26/2017 10:10:05 AM

Thanks in advance
Your format string is not correct.

HH:MM:SS should be HH:MI:SS.

Also, when using the 12 hour format, midnight is 12:00:00 AM, not 00:00:00 AM.