Re: Postgres RFC3339 datetime formatting

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Postgres RFC3339 datetime formatting
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B5384D8EA@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на Postgres RFC3339 datetime formatting  (Jasim Mohd <hello@jasimmk.com>)
Список pgsql-general
Jasim Mohd wrote:
> Is there any way to format datetime to RFC3339Nano Eg: 2006-01-02T15:04:05.999999999Z07:00 in postgres
> 9.3 or 9.5?
> 
> I tried with to_char. But there is no documentation how to handle T, Z, +07:00, -07:00 etc.

The best I can get is:

SELECT to_char(current_timestamp, 'FXYYYY-MM-DD"T"HH:MI:SS.US"000Z"OF');

but it will suppress the minute part of the time zone offset if it is 0.

I don't think you can get nanosecond precision in PostgreSQL.

Is that good enough?

Yours,
Laurenz Albe

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

Предыдущее
От: Roman Khalupa
Дата:
Сообщение: Build postgresql
Следующее
От: John McKown
Дата:
Сообщение: Re: Postgres RFC3339 datetime formatting