Re: to_timestamp overloaded to convert from Unix epoch

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: to_timestamp overloaded to convert from Unix epoch
Дата
Msg-id 411DE079.1070207@familyhealth.com.au
обсуждение исходный текст
Ответ на to_timestamp overloaded to convert from Unix epoch  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: to_timestamp overloaded to convert from Unix epoch  (Michael Glaesemann <grzm@myrealbox.com>)
Список pgsql-patches
I wonder...

Maybe you don't need to override to_timestamp, and you can just add a
new code to the format string that to_timestamp understands, ie 'e' or
something or 'u' that means 'unix timestamp'?

Chris

Michael Glaesemann wrote:

> Please find attached a patch (diff -c against cvs HEAD) to add a
> function that accepts a double precision argument assumed to be a Unix
> epoch timestamp and returns timestamp with time zone, and accompanying
> documentation.
>
> Usage:
>
> test=# select to_timestamp(200120400);
>       to_timestamp
> ------------------------
>  1976-05-05 14:00:00+09
> (1 row)
>
> If regression tests are required, I will produce some. I'd appreciate
> any pointers as to what to look for, as they would be my first attempt
> at writing regression tests.
>
> Regards
>
> Michael Glaesemann
> grzm myrealbox com
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

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

Предыдущее
От: "Serguei Mokhov"
Дата:
Сообщение: Translation updates for 8.0: initdb-ru, psql-ru
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] [Fwd: Re: [pgsql-hackers-win32] Import from Linux to