Re: [HACKERS] New date/time formats

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] New date/time formats
Дата
Msg-id 30fa9ab29bdfa02aa2735efb36807be6
обсуждение исходный текст
Ответ на [HACKERS] New date/time formats  ("Dorte Munk-Jakobsen" <munk@pt.lu>)
Список pgsql-hackers
Dorte Munk-Jakobsen wrote:
> With all these changes currently being done on date/time would it be
> possible to add support for one or two new formats when selecting dates
> from the database?
> I would very much like to see formats such as 'J' for Julian date and 'W'
> for day of week, represented as a number or the text string representing
> the day.

Have you looked at date_part()? You can retrieve all of the fields
individually (as numbers) including day of week. This works for
"datetime" and possibly "abstime" (if abstime is not in v6.1 I have the
code ready to go into the v6.2 source tree after July 1).

I'll think about how to get Julian date directly; the code already will
give you seconds from 1970 by calling date_part('epoch', datetime)

            - Tom

------------------------------

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