Re: Interval examples

From: Andrew McMillan <Andrew(at)catalyst(dot)net(dot)nz>
To: George Robinson II <george(dot)robinson(at)eurekabroadband(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Interval examples
Date: 2000-08-16 12:29:20
Message-ID: 399A8920.97B94B96@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

George Robinson II wrote:
>
> Could someone please send me some examples of the interval data type?
> For example, what should the data look like in order to do and insert?
> If I have two iso time stamps, how can I insert them into the interval
> datatype? What are some ways to format the output of an interval type?
>
> Note: When working in perl, I have found the "Perl Cookbook" the most
> valuable asset I have. I think we should get together and produce a web
> site where people can submit various type of code involving postgres, so
> that newbies (such as myself) have lots of material to learn from. I'll
> have plenty of examples to submit when I'm done with this project. And
> I'd do it myself, but I'm not really a web guy.
>
> Thanks for the help

select interval( datetime('now') - datetime('today'));
interval
-------------------
@ 28 mins 32 secs
(1 row)

Just as a suggestion...

Cheers,
Andrew.
--
_____________________________________________________________________
Andrew McMillan, e-mail: Andrew(at)cat-it(dot)co(dot)nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64 (21) 635 694, Fax: +64 (4) 499 5596, Office: +64 (4) 499 2267

In response to

Browse pgsql-general by date

  From Date Subject
Next Message mikeo 2000-08-16 13:04:51 Re: bytea question
Previous Message Len Morgan 2000-08-16 12:15:13 Re: date/time functions