RE: [GENERAL] Epoch Time, conversion? - Mailing list pgsql-general

From Jackson, DeJuan
Subject RE: [GENERAL] Epoch Time, conversion?
Date
Msg-id F10BB1FAF801D111829B0060971D839F4D733E@cpsmail
Whole thread Raw
List pgsql-general
> 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 by date:

Previous
From: "Jackson, DeJuan"
Date:
Subject: RE: [GENERAL] age('now',date::datetime)
Next
From: "Bryan White"
Date:
Subject: Muiltiple commands to psql yeilds a bad COPY