Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AC15A632668 for ; Thu, 15 Jul 2010 04:18:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 25729-03 for ; Thu, 15 Jul 2010 07:18:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 9D4BF62F6AC for ; Thu, 15 Jul 2010 04:18:42 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OZIiO-00073k-SI for pgsql-sql@postgresql.org; Thu, 15 Jul 2010 09:18:40 +0200 Received: from 217.110.94.67 ([217.110.94.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 09:18:40 +0200 Received: from spam_eater by 217.110.94.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 09:18:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: subtract two dates to get the number of days Date: Thu, 15 Jul 2010 09:18:29 +0200 Lines: 30 Message-ID: References: <4C3DAF72.6030606@verizon.net> <4C3DEE40.1040208@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.67 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: <4C3DEE40.1040208@verizon.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.954 tagged_above=-5 required=5 tests=BAYES_50=0.8, RCVD_NUMERIC_HELO=1.164, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201007/73 X-Sequence-Number: 34386 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