Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()
Дата
Msg-id 20021223093810.GA30081@zf.jcu.cz
обсуждение исходный текст
Ответ на Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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/

В списке pgsql-general по дате отправления:

Предыдущее
От: "Billy G. Allie"
Дата:
Сообщение: Re: PerformPortalClose warning in 7.3
Следующее
От: SZUCS Gábor
Дата:
Сообщение: Re: How to backup a postgreSQL of 80 GByte ?