Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 37552 invoked from network); 24 Oct 2009 09:59:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Oct 2009 09:59:04 -0000 Received: (qmail 24394 invoked by uid 500); 24 Oct 2009 09:59:04 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 24327 invoked by uid 500); 24 Oct 2009 09:59:04 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 24319 invoked by uid 99); 24 Oct 2009 09:59:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Oct 2009 09:59:04 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [80.12.242.17] (HELO smtp19.orange.fr) (80.12.242.17) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Oct 2009 09:59:01 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1914.orange.fr (SMTP Server) with ESMTP id 1657220000AD for ; Sat, 24 Oct 2009 11:58:40 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1914.orange.fr (SMTP Server) with ESMTP id 06BC020000B1 for ; Sat, 24 Oct 2009 11:58:40 +0200 (CEST) Received: from [10.129.36.10] (Mix-Rennes201-1-42.w193-250.abo.wanadoo.fr [193.250.26.42]) by mwinf1914.orange.fr (SMTP Server) with ESMTP id 5784320000AD for ; Sat, 24 Oct 2009 11:58:39 +0200 (CEST) X-ME-UUID: 20091024095839358.5784320000AD@mwinf1914.orange.fr Message-ID: <4AE2CFCD.70603@wanadoo.fr> Date: Sat, 24 Oct 2009 11:58:37 +0200 From: Sylvain Leroux Organization: http://www.chicoree.fr User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Derby Discussion Subject: Re: time format (or: the curse of dst) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi Fabio, Maybe this is overly simplistic, but why not storing *GMT* datetime? In that eventuality, some custom written functions would also be necessary to convert from/to your specific time format. Sylvain Fabio a �crit : > > Hello, > > I'm using Apache Derby to store hourly values of electricity > consumption. The values are used in an electricity market simulation > implemented in Java. > > Now because of DST, hourly values mean that (for central Europe): > - one day in March has 23 hours (there's no 2 a.m. to 3 a.m. during that > night) > - one day in October has 25 hours (2 a.m. to 3 a.m. appears twice during > that night) > > The data in October is published as: > (..) > 02:00 > 3A:00 > 3B:00 > 04:00 > 05:00 > (..) > > I have yet to find a good solution on how to store this data in the > database. Obviously, "3A:00" is not a valid time format. > Currently, I'm storing the consumption data in conjunction with a field > named "hour_in_year" (1-8760) but having the date and time is more handy > for sql select queries. > > Any ideas how to support the "curse of dst" in a time field? > > Fabio > > -- Website: http://www.chicoree.fr