RE: [GENERAL] Epoch Time, conversion?

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: A James Lewis <james(at)vrtx(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: RE: [GENERAL] Epoch Time, conversion?
Date: 1998-11-05 19:26:48
Message-ID: F10BB1FAF801D111829B0060971D839F4D733E@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is there any facility to convert "Epoch time <-> DATE" as that would
> be
> rather useful.....
>
> James (james(at)linuxrocks(dot)co(dot)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';

Browse pgsql-general by date

  From Date Subject
Next Message Bryan White 1998-11-05 20:25:50 Muiltiple commands to psql yeilds a bad COPY
Previous Message Jackson, DeJuan 1998-11-05 18:47:14 RE: [GENERAL] age('now',date::datetime)