Re: How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ? |
| Дата | |
| Msg-id | 26997.1063165265@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ? ("Bruno BAGUETTE" <pgsql-ml@baguette.net>) |
| Ответы |
RE : How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?
RE : How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ? |
| Список | pgsql-general |
"Bruno BAGUETTE" <pgsql-ml@baguette.net> writes:
> I'm looking for a way to convert a unix timestamp to a PostgreSQL date
> without using ::abstime which seems to be deprecated.
abstime is not yet deprecated in my mind, precisely because it's still
the easiest way to do the reverse of "extract(epoch from timestamp)".
The cleanest alternative I know of is
select 'epoch'::timestamptz + (unixtimestamphere) * '1 sec'::interval;
but this still leaves an unsatisfied feeling. Sooner or later we'll
probably invent an explicit function to do this conversion.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера