0

The following query returns me the wrong time in Oracle's SQL Developer tool, more specifically the minutes are a bit off. I added a screenshot to make the issue clearer. The time of execution was 2:12, but the query returned 2:05. If I remove the to_char function however, the minutes are right. What am I doing wrong in my to_char function?

Query result with wrong time

select to_char(systimestamp at local, 'DD-MON-YYYY HH24:MM:SS') from dual;

MT0
  • 143,790
  • 11
  • 59
  • 117
Hollow
  • 1
  • 1
  • 3
    `MM` is not a format model for minutes. Use `mi` instead: https://docs.oracle.com/cd/E11882_01/server.112/e41085/sqlqr07001.htm#SQLQR977 – Sayan Malakshinov May 23 '22 at 00:34
  • 2
    That is: the time component should be `HH24:MI:SS` (note MI instead of MM). MM means month (as a two-digit number), that is why you get 2:05 - 05 is the month, not the minute. –  May 23 '22 at 00:47

0 Answers0