Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Convert from Seconds-Since-Epoch to Timestamp


  • From: Jie Liang <jliang(at)ipinc(dot)com>
  • To: "Brian C. Doyle" <bcdoyle(at)mindspring(dot)com>
  • Cc: pgsql-sql(at)postgresql(dot)org
  • Subject: Re: Convert from Seconds-Since-Epoch to Timestamp
  • Date: Thu, 21 Sep 2000 13:25:05 -0700
  • Message-id: <39CA6EA1.5610BD7@ipinc.com> <text/plain>

Hi, there,

urldb=# create table foo(sec int4);
CREATE
urldb=# insert into foo values(54321);
INSERT 382942319 1
urldb=# select interval(reltime (sec||'secs')) from foo;
 interval
----------
 15:05:21
(1 row)


"Brian C. Doyle" wrote:

> how would you do that with in a query?
>
> ie select date , interval(reltime 'table.secs');
>
> when the value in table.secs = 54321 and "secs" is not a part of it?
>
> At 11:35 AM 9/21/00 -0700, Jie Liang wrote:
> >Hi, Webb,
> >
> >I am not quit sure what you really want to do, however, I assume that
> >following maybe
> >what you mean:
> >
> >
> >db=# select interval(reltime '12313221 secs');
> >       interval
> >--------------------
> >  4 mons 22 12:20:21
> >(1 row)
> >
> >
> >Webb Sprague wrote:
> >
> > > Hi all,
> > >
> > > How do I convert from seconds (an integer) to
> > > timestamp?
> > >
> > > I am sure it is easy, but I can't find it in the docs,
> > > so far.
> > >
> > > Thanks
> > > Webb
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Send instant messages & get email alerts with Yahoo! Messenger.
> > > http://im.yahoo.com/
> >
> >--
> >Jie LIANG
> >
> >Internet Products Inc.
> >
> >10350 Science Center Drive
> >Suite 100, San Diego, CA 92121
> >Office:(858)320-4873
> >
> >jliang(at)ipinc(dot)com
> >www.ipinc.com

--
Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang(at)ipinc(dot)com
www.ipinc.com






Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group