Re: subtract two dates to get the number of days

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: subtract two dates to get the number of days
Date: 2010-07-15 07:18:29
Message-ID: i1mco5$3fk$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jean-David Beyer, 14.07.2010 19:05:
> I just looked them up in my data definitions. Dates are _stored_ as type
>
> DATE NOT NULL
Very good ;)

> Yes, if the data happen to be stored at all. But when a program
> generates the dates dynamically and wants to produce queries from them,
> it is easier to use the C++ class to generate the dates.
Yes of course.

>>> Years ago, I made a C++ data type that allowed a date datatype where I
>>> could add, subtract, and so on.
>>> I use it in programs that do not necessarily use a database,
>
>> To be honest: I expect the programming language to support those things.
>
> I would love it. For all I know, the C++ Standard Library supports it
> now, but I do not believe it did when I wrote that class.
Ah, those "historic" things. I primarily use Java and that had Date support right from the start.

> Well, €0.02 is still more than my US$0.02, I believe.

Nice one :)

Regards
Thomas

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message REISS Thomas DSIC BIP 2010-07-15 09:16:03 Re: Question on COUNT performance
Previous Message Lee Hachadoorian 2010-07-15 03:43:35 Re: Question on COUNT performance