pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: Re: Date interval
Date: Fri, 26 Sep 2003 10:16:10 +0400
Message-ID: <200309261016.10724.sad@bankir.ru> (raw)
In-Reply-To: <002901c383ed$a70423a0$8f601ad3@athlon2000>
References: <002901c383ed$a70423a0$8f601ad3@athlon2000>

On Friday 26 September 2003 09:18, you wrote:
> I am looking for a way to convert an interval into a number of days (
> integer);
>
> In sybase I would use :
>
> days(today()-r_expire)

SELECT  now()::DATE - '1900-12-10'::DATE;

            ?column?            
--------------------------------
 37545


SELECT  now()-'1900-12-10'::timestamp;

            ?column?            
--------------------------------
 37545 days 06:10:54.2021608353






view thread (8+ messages)  latest in thread

Message-ID: <200309261016.10724.sad@bankir.ru>
Permalink:  ../200309261016.10724.sad@bankir.ru/
Also on:    postgresql.org/message-id/200309261016.10724.sad@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: Date interval
  In-Reply-To: <200309261016.10724.sad@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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