| От | Bill Morrow |
|---|---|
| Тема | converting seconds since epoch to time string |
| Дата | |
| Msg-id | 20001114160420.A16639@lunk.dhs.org обсуждение исходный текст |
| Ответы |
Re: converting seconds since epoch to time string
Re: converting seconds since epoch to time string |
| Список | pgsql-novice |
I have an integer column which holds a time represented
as the number of seconds since 1970/01/01 00:00 UTC. I want to
view this table with the time converted to an understandable text string.
I've experimented with things like
select to_char('epoch'::datetime + '973660200 seconds'::interval, 'dd/mm/yyyy hh:mi');
to_char
------------------
07/11/2000 10:10
but can't see anyway to use the time column in my table, instead of a hardcode
number of seconds.
In Sybase, you can use the dateadd() function to do this:
select dateadd( seconds, time, '1/1/70') from tablename
Thanks,
Bill
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера