missing "day(s)" in interval (was: Convert from Seconds-Since-Epoch to Timestamp)

Lists: pgsql-sql
From: Webb Sprague <wsprague100(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Convert from Seconds-Since-Epoch to Timestamp
Date: 2000-09-21 18:10:36
Message-ID: 20000921181036.3514.qmail@web805.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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/


From: Jie Liang <jliang(at)ipinc(dot)com>
To: Webb Sprague <wsprague100(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Convert from Seconds-Since-Epoch to Timestamp
Date: 2000-09-21 18:35:30
Message-ID: 39CA54F2.9818B78@ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(at)ipinc(dot)com
www.ipinc.com


From: "Brian C(dot) Doyle" <bcdoyle(at)mindspring(dot)com>
To: Jie Liang <jliang(at)ipinc(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Convert from Seconds-Since-Epoch to Timestamp
Date: 2000-09-21 18:55:08
Message-ID: 5.0.0.19.2.20000921145244.02438d00@pop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(at)ipinc(dot)com
>www.ipinc.com


From: Jie Liang <jliang(at)ipinc(dot)com>
To: "Brian C(dot) Doyle" <bcdoyle(at)mindspring(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Convert from Seconds-Since-Epoch to Timestamp
Date: 2000-09-21 20:25:05
Message-ID: 39CA6EA1.5610BD7@ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(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


From: Louis-David Mitterrand <cunctator(at)apartia(dot)ch>
To: pgsql-sql(at)postgresql(dot)org
Subject: missing "day(s)" in interval (was: Convert from Seconds-Since-Epoch to Timestamp)
Date: 2000-09-23 15:45:20
Message-ID: 20000923174520.A10680@styx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

On Thu, Sep 21, 2000 at 01:25:05PM -0700, Jie Liang wrote:
> 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)

By the way, is it normal that the "day" word doesn't appear in the interval?

auction=# select interval(now()::abstime::int4);
interval
----------------------------
30 years 9 mons 3 15:42:09
(1 row)

--
Louis-David Mitterrand - ldm(at)apartia(dot)org - http://www.apartia.org

"Perl Guy and Executive Glue Sniffer"
(stolen from Aaron Sherman's .sig)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ldm(at)apartia(dot)ch
Cc: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, pgsql-sql(at)postgresql(dot)org
Subject: Re: missing "day(s)" in interval (was: Convert from Seconds-Since-Epoch to Timestamp)
Date: 2000-09-23 16:46:18
Message-ID: 1823.969727578@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Louis-David Mitterrand <cunctator(at)apartia(dot)ch> writes:
> By the way, is it normal that the "day" word doesn't appear in the interval?

> auction=# select interval(now()::abstime::int4);
> interval
> ----------------------------
> 30 years 9 mons 3 15:42:09
> (1 row)

Looks like a bug to me ... Thomas, do you agree?

Curiously, it appears that the interval input converter will accept this
with or without the 'days' keyword included.

regards, tom lane