The sql below using dual reproduces the issue:
SELECT TRUNC (SYSDATE) example,
TO_CHAR (TRUNC (SYSDATE), 'FMMonth dd, yyyy')
|| ' '
|| TO_CHAR (TRUNC (SYSDATE), 'hh:MI AM') result_one,
TO_CHAR (TRUNC (SYSDATE), 'FMMonth dd, yyyy hh:MI AM') result_two
FROM DUAL
Output:
EXAMPLE RESULT_ONE RESULT_TWO
12/4/2012 December 4, 2012 12:00 AM December 4, 2012 12:0 AM
Note how the RESULT_TWO output is missing a zero in the minute value of the time, while RESULT_ONE does not. RESULT_ONE is my current workaround by appending two separate format instructions. The issue occurs on any time value where the minutes contain a zero (e.g. 11:02 AM).
Any suggestion on how to perform the TO_CHAR without using the RESULT_ONE work around?
Oracle Version Info
> BANNER Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 -
> 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production
> TNS for Solaris: Version 10.2.0.4.0 - Production NLSRTL Version
> 10.2.0.4.0 - Production
You can apply the
fmmodifier to multiple format masks