Re: converting epoch to timestamp

Поиск
Список
Период
Сортировка
От Stef
Тема Re: converting epoch to timestamp
Дата
Msg-id 20051026113142.25ec9045@svb.ucs.co.za
обсуждение исходный текст
Ответ на converting epoch to timestamp  (Rajesh Kumar Mallah <mallah.rajesh@gmail.com>)
Ответы SETOF RECORD RETURN VALUE  ("Christian Paul B. Cosinas" <cpc@cybees.com>)
Список pgsql-sql
Rajesh Kumar Mallah mentioned :
=> Can anyone tell me how to convert epoch to timestamp ?
=> 
=> ie reverse of :
=> 
=> SELECT EXTRACT( epoch FROM  now() );
=> +------------------+
=> |    date_part     |
=> +------------------+
=> | 1130317518.61997 |
=> +------------------+

Here is one way (In my case I still had to add/subtract timezone diff)
select '19700101'::timestamp + foo.epoch::interval from (select extract(epoch from now())||' seconds' as epoch) foo ;


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: converting epoch to timestamp
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: pl/* overhead ...