Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8175B1337B47 for ; Tue, 8 Feb 2011 16:23:33 -0400 (AST) 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 11843-03 for ; Tue, 8 Feb 2011 20:23:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zebedee.cranntara.net (unknown [91.186.7.82]) by mail.postgresql.org (Postfix) with ESMTP id 06D35133616B for ; Tue, 8 Feb 2011 16:23:25 -0400 (AST) Received: from [88.210.158.208] (helo=bolek.coachhouse) by zebedee.cranntara.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PmtU4-0005Yk-Qo for pgsql-sql@postgresql.org; Tue, 08 Feb 2011 19:44:23 +0000 Received: from [192.168.0.32] (helo=dick.coachhouse ident=tarlika) by bolek.coachhouse with esmtp (Exim 4.69) (envelope-from ) id 1PmtDf-0003es-Lt for pgsql-sql@postgresql.org; Tue, 08 Feb 2011 19:27:23 +0000 Date: Tue, 8 Feb 2011 19:27:23 +0000 From: "Tarlika Elisabeth Schmitz" To: Subject: Re: data import: 12-hour time w/o AM/PM Message-ID: <20110208192723.31d028a6@dick.coachhouse> In-Reply-To: <74DB3341AB704E989C87CAAD89D2526F@marktestcr.marktest.pt> References: <20110208181400.2e88d7cc@dick.coachhouse> <74DB3341AB704E989C87CAAD89D2526F@marktestcr.marktest.pt> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201102/44 X-Sequence-Number: 35120 On Tue, 8 Feb 2011 18:38:44 -0000 "Oliveiros d'Azevedo Cristina" wrote: >----- Original Message ----- >From: "Tarlika Elisabeth Schmitz" >To: >Sent: Tuesday, February 08, 2011 6:14 PM >Subject: [SQL] data import: 12-hour time w/o AM/PM > > >I am importing data in CSV format. My technique is to COPY the data >into interim tables (starting with a "z") where I analyze them, clean >up inconsistencies; eventually I will populate the "proper" tables with >these data. (In the example below: COPY CSV into zevent, from there >populate event.) > >The time field of the event data is givng me a headache: it's in 12h >format but without the AM/PM qualifier! > >Howdy, Tarlika. > >If the data doesn't bring the AM/PM how are you supposed to >distinguish between,say, 10pm and 10am ? Does it always start at >10:30am? So 10am never arises? > >Best, >Oliveiros > On a given day, between 6-9 events are staged, about 1/2 hour apart. If the set of events spans 12:00, I definitely know that this isn't midnight. I also know the order within a set. Looking at a particular location, which contributes to 80% of the data, there have been no events at 10:?? ever (so far). Looking at it as a human being I can decide in a fraction of a second whether it's AM or PM. I just can't think of an automated procedure how to transform this half-baked 12-hour nonsense into a time.