Date formatting

Поиск
Список
Период
Сортировка
От Mavka
Тема Date formatting
Дата
Msg-id 20160428110753.2700f00d@nikita_desk
обсуждение исходный текст
Ответы Re: Date formatting
Список pgsql-docs
To convert a string to date I need to omit meaningless parts. I found
this format working well (Twitter dump format):

SELECT to_timestamp(
  'Tue Sep 24 08:56:18 +0000 2013',
  'xxx Mon DD HH24:MI:SS xxxxx YYYY'
)
-- 2013-09-24 08:56:18-07

In place of "xxx" I can use any non-reserved symbols, e.g.:

'aaa Mon DD HH24:MI:SS bbbbb YYYY'

Number of symbols can vary in some limits, e.g. 'aa' is still working.

Is it hack or normal behaviour of parser? I did not find any mention of
wildcards or placeholders in documentation:

http://www.postgresql.org/docs/9.5/static/functions-formatting.html

Best regards,
Mavka

P.S. I use PostgreSQL 9.4.


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

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: COPY options
Следующее
От: "Andrei M. Eichler"
Дата:
Сообщение: Re: COPY options