Problem w/ date calculation.

From: Mike Diehl <jdiehl(at)sandia(dot)gov>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Problem w/ date calculation.
Date: 2002-11-06 19:38:35
Message-ID: 20021106201818.72BE555A9@dominion.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'm having a problem with a date calculation. I'm trying to get a list of
all records who's "last_backed_up" field indicates one day or older.

But, I'm doing something wrong with age().

For example, if the current date is:
mapping=# select now();
now
------------------------------
2002-11-06 16:16:09.62247-07
(1 row)

Then the age of a field containing 2002-11-05 17:25:33.89754-07 should be
about 23 hours, right?

Well:
mapping=# select age(timestamp '2002-11-05 17:25:33.89754-07');
age
----------------
06:34:26.10246
(1 row)

What am I missing?

TIA.

--
Mike Diehl
Network Tools Devl.
SAIC at Sandia Labs
(505) 284-3137

Browse pgsql-general by date

  From Date Subject
Next Message Simeó Reig 2002-11-06 19:45:06 Re: CURRENT_TIME
Previous Message Andrew Sullivan 2002-11-06 18:49:07 Re: Synchronising/mirroring databases