Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date Formats with the time component

Roxy rollersOct 4 2023 — edited Oct 4 2023

Hi there everyone,

I am trying to get the correct date format here and I am noticing that this date format I am using is truncating the leading 0 in the minute component. Any help in this regard is greatly appreciated.

Thanks

select to_char(SYSDATE,'fmDay, fmDD fmMonth, YYYY HH24:MI') from dual;

Of course, this only happens when SYSDATEs minute component is between :00 and :09. Currently, it's working well as it's 31 minutes past the hour.

Wednesday, 04 October, 2023 13:31

So, a half hour back, I would get something like this:

Wednesday, 04 October, 2023 13:1

However, when I do this then I get the correct minute component.

select to_char(SYSDATE,'YYYY HH24:MI') from dual;

2023 13:39
This post has been answered by mathguy on Oct 4 2023
Jump to Answer
Comments
Post Details
Added on Oct 4 2023
4 comments
1,299 views