pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Erwin Moller <erwin@dexus.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: datediff?
Date: Sun, 27 Oct 2002 11:49:16 -0800
Message-ID: <web-1801028@davinci.ethosmedia.com> (raw)
In-Reply-To: <3.0.6.32.20021027200612.00866960@pop.xs4all.nl>

Erwin,

> Thanks for your quick response Josh.
> 
> I wasn't aware of the Postgresql-function DATEDIFF()
> The accolade ' is not a problem of course!

Whoops!   Didn't want to confuse you.   What I meant was, a PgSQL
function "Datediff" could be easily *written*, except that it would
need quoted identifiers, different from the T-SQL function.   If anyone
on this list has written a DateDiff, please post!

> But I have to say to my shame, I was asking you too soon, because all
> I
> really needed was a function that could return me some absolute
> timediff,
> and I found date_part('epoch', date) does the trick nicely enough for
> me.
> I can now take the diff in millisecs since start of epoch, which is
> enough
> to do all other calculations easily.

Cool!   Glad that you found something that would work for you.

-Josh



view thread (2+ messages)

Message-ID: <web-1801028@davinci.ethosmedia.com>
Permalink:  ../web-1801028@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1801028@davinci.ethosmedia.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: josh@agliodbs.com, erwin@dexus.nl
  Subject: Re: datediff?
  In-Reply-To: <web-1801028@davinci.ethosmedia.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