>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> For a moment I thought you could do to_char(now(),'Day DD Month YYYY' >> but you're quite right you need to
rtrim()the various pieces.
Tom> regression=# select to_char(now()-10,'Day DD Month YYYY'); Tom> to_char Tom>
----------------------------- Tom> Sunday 04 March 2001 Tom> (1 row)
Tom> regression=# select to_char(now()-10,'fmDay fmDD fmMonth YYYY'); Tom> to_char Tom>
--------------------- Tom> Sunday 4 March 2001 Tom> (1 row)
Tom> The 'fm' prefix is not very well explained in the docs at
It doesn't seem to be explained at all, just listed in the table. I'd
suggest adding the following (and perhaps include your example selects from
above) to the usage notes below table 4-11:
o to_char() does not remove trailing blanks from fields which are blank padded, e.g., `Day' and `Month', unless
the`FM' prefix is used.
roland
-- PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland@rlenter.com 76-15 113th Street, Apt 3B
rbroberts@acm.org Forest Hills, NY 11375