pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Jean-Paul Argudo <jean-paul@argudo.org>
Cc: pgsql-sql@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Martin Marques <martin@bugs.unl.edu.ar>
Subject: Re: age() vs. timestamp substraction
Date: Fri, 6 Oct 2006 06:56:51 -0700 (PDT)
Message-ID: <20061006065548.A16785@megazone.bigpanda.com> (raw)
In-Reply-To: <45262362.4030101@argudo.org>
References: <cbcf271add3140fe7cff8d45f31af585@bugs.unl.edu.ar>
	<29752.1160073444@sss.pgh.pa.us>
	<45262362.4030101@argudo.org>

On Fri, 6 Oct 2006, Jean-Paul Argudo wrote:

> Hi all,
>
> > Where did you get that idea?  age's reference point is current_date (ie,
> > midnight) not now().  There are also some differences in the calculation
> > compared to a plain timestamp subtraction.
>
> I'm jumping on this thread to point out a little strange thing to me.
> CURRENT_DATE, converted (stupidly) as a string *with* hour is "current
> date at mid-day":
>
>
> test=# select to_char(current_date,'YYYY-MM-DD HH:MI:SS');
>        to_char
> ---------------------
>  2006-10-06 12:00:00
> (1 ligne)
>
> It was a day when I had to debug a strange behaviour in a customer's
> (bad) code :-)

That's both midnight and mid-day. It's asking for 12 hour time and no
AM/PM marker.



view thread (5+ messages)

Message-ID: <20061006065548.A16785@megazone.bigpanda.com>
Permalink:  ../20061006065548.A16785@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20061006065548.A16785@megazone.bigpanda.com

 · 

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: sszabo@megazone.bigpanda.com, jean-paul@argudo.org, tgl@sss.pgh.pa.us, martin@bugs.unl.edu.ar
  Subject: Re: age() vs. timestamp substraction
  In-Reply-To: <20061006065548.A16785@megazone.bigpanda.com>

* 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