Обсуждение: Re: [pgsql-general] Daily Digest V1 #2891

Поиск
Список
Период
Сортировка

Re: [pgsql-general] Daily Digest V1 #2891

От
Karl DeBisschop
Дата:
On Thu, 2002-12-19 at 11:22, Jochem van Dieten wrote:
> > No bites on the offset from UTC yet, but this definitely cleans up some
> > code.
>
> SELECT ... AT TIME ZONE '...' perhaps?

I don't see how that helps. to_char() still doesn't document a format
specifier for offset from UTC, at least as far as I can see.

I could do

| news=> set datestyle TO 'ISO';
| SET VARIABLE
| news=> select now();
|               now
| -------------------------------
|  2002-12-19 11:27:40.145603-05
| (1 row)


But that has spaces instead of the 'T'

I want to be able to pass this in and out of HTTP GET statements without
having to worry about ecaping/unescaping spaces. If I could tweak the
ISO output format, that would be fine too. Maybe I'll look down that
alley... (in that case, I'd want to decrease the time precision too, but
that would not be necessary, only desirable).

Thanks though, and if I missed something in your suggestion, feel free
to set me straight.

--
Karl DeBisschop <kdebisschop@alert.infoplease.com>
Pearson Education/Information Please


Re: [pgsql-general] Daily Digest V1 #2891

От
Tom Lane
Дата:
Karl DeBisschop <kdebisschop@alert.infoplease.com> writes:
> I could do
> | news=> set datestyle TO 'ISO';
> | SET VARIABLE
> | news=> select now();
> |               now
> | -------------------------------
> |  2002-12-19 11:27:40.145603-05
> | (1 row)

> But that has spaces instead of the 'T'

In 7.3, this works:

regression=# set datestyle TO 'ISO';
SET
regression=# select replace(current_timestamp(2)::text, ' ', 'T');
          replace
---------------------------
 2002-12-19T11:46:15.91-05
(1 row)


            regards, tom lane