RE: [GENERAL] Epoch Time, conversion?

Поиск
Список
Период
Сортировка
Искать
От
Jackson, DeJuan
Тема
RE: [GENERAL] Epoch Time, conversion?
Дата
Msg-id
F10BB1FAF801D111829B0060971D839F4D733E@cpsmail
Список
> Is there any facility to convert "Epoch time <-> DATE" as that would
> be
> rather useful.....
> 
> James (james@linuxrocks.co.uk)
> Vortex Internet
> My Windows unders~1 long filena~1, and yours?
> 
Assuming v6.4 with plpgsql...
How's this:
create function epoch2dtm(float8) returns datetime AS '
 declare
   myepoch alias for $1;
 begin
    return (now() - 
 (date_part(''epoch'', now()::datetime)::int4 || '' seconds'')::timespan
+ 
 (myepoch::int4 || '' seconds'')::timespan)::datetime;
 end;' language 'plpgsql';
В списке pgsql-general по дате отправления
От: Jackson, DeJuan
Дата:
От: Bryan White
Дата:
FAQ