Oracle Date TO_CHAR('Month DD, YYYY') has extra spaces in it

前端 未结 6 1715
渐次进展
渐次进展 2020-12-03 10:18

When I do...

Select TO_CHAR (date_field, \'Month DD, YYYY\')
from...

I get the following:

July      01, 2011
April     01,          


        
6条回答
  •  孤城傲影
    2020-12-03 10:47

    Why are there extra spaces between my month and day? Why does't it just put them next to each other?

    So your output will be aligned.

    If you don't want padding use the format modifier FM:

    SELECT TO_CHAR (date_field, 'fmMonth DD, YYYY') 
      FROM ...;
    

    Reference: Format Model Modifiers

提交回复
热议问题