On Thu, Dec 19, 2002 at 10:50:51AM -0500, Tom Lane wrote:
> "Peter Gibbs" <peter@emkel.co.za> writes:
> > select to_char(now()+'3 days'::interval,'YYYY-MM-DDTHH24:MI:SS');
> > to_char
> > -----------------------
> > 2002-12-22NDH24:41:58
>
> Oh, duh --- "TH" is a format modifier. That's what's confusing it
> (and today being the 19TH is what's confusing us).
# select to_char(now(),'DDth Mon YYYY');
to_char
---------------
23rd Dec 2002
> So the suggestion of ... DD"T"HH ... is the way to go.
Right, Tom read docs :-).
Please, use it in always if you want to put non-format modifier into
formatting strings.
# select to_char(now(),'"YYYY-MM-DD HH24:MI:SS =" YYYY-MM-DD HH24:MI:SS');
to_char
---------------------------------------------
YYYY-MM-DD HH24:MI:SS = 2002-12-23 10:33:40
Karel
PS. sorry of my delay in this discussion, I was out of town.
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/