pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Convert from Seconds-Since-Epoch to Timestamp
4+ messages / 3 participants
[nested] [flat]

* Convert from Seconds-Since-Epoch to Timestamp
@ 2000-09-21 18:10  Webb Sprague <wsprague100@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Webb Sprague @ 2000-09-21 18:10 UTC (permalink / raw)
  To: pgsql-sql

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/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Convert from Seconds-Since-Epoch to Timestamp
@ 2000-09-21 18:35  Jie Liang <jliang@ipinc.com>
  parent: Webb Sprague <wsprague100@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Jie Liang @ 2000-09-21 18:35 UTC (permalink / raw)
  To: Webb Sprague <wsprague100@yahoo.com>; +Cc: pgsql-sql

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@ipinc.com
www.ipinc.com






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Convert from Seconds-Since-Epoch to Timestamp
@ 2000-09-21 18:55  Brian C. Doyle <bcdoyle@mindspring.com>
  parent: Webb Sprague <wsprague100@yahoo.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Brian C. Doyle @ 2000-09-21 18:55 UTC (permalink / raw)
  To: Jie Liang <jliang@ipinc.com>; +Cc: pgsql-sql

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@ipinc.com
>www.ipinc.com




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Convert from Seconds-Since-Epoch to Timestamp
@ 2000-09-21 20:25  Jie Liang <jliang@ipinc.com>
  parent: Brian C. Doyle <bcdoyle@mindspring.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Jie Liang @ 2000-09-21 20:25 UTC (permalink / raw)
  To: Brian C. Doyle <bcdoyle@mindspring.com>; +Cc: pgsql-sql

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@ipinc.com
> >www.ipinc.com

--
Jie LIANG

Internet Products Inc.

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

jliang@ipinc.com
www.ipinc.com






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-09-21 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-21 18:10 Convert from Seconds-Since-Epoch to Timestamp Webb Sprague <wsprague100@yahoo.com>
2000-09-21 18:35 ` Jie Liang <jliang@ipinc.com>
2000-09-21 18:55 ` Brian C. Doyle <bcdoyle@mindspring.com>
2000-09-21 20:25   ` Jie Liang <jliang@ipinc.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox