Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 52815 invoked from network); 13 Nov 2008 13:09:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2008 13:09:51 -0000 Received: (qmail 95507 invoked by uid 500); 13 Nov 2008 13:09:58 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 95277 invoked by uid 500); 13 Nov 2008 13:09:57 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 95266 invoked by uid 99); 13 Nov 2008 13:09:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 05:09:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jukka.zitting@gmail.com designates 209.85.198.226 as permitted sender) Received: from [209.85.198.226] (HELO rv-out-0506.google.com) (209.85.198.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 13:08:38 +0000 Received: by rv-out-0506.google.com with SMTP id k40so911682rvb.31 for ; Thu, 13 Nov 2008 05:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=+DA853oaekpjgUFDqOdkILrCo4nVi2MSkw214u+lmSc=; b=M92QIwGZUA41U6pap+5mH8T7kGdl6k6Tg8LWJp6ge5DvzJ0yIDjDZVgrchJ3j0LxMp Xh9WkOKmflf0hOc5kOVpXBMwGcoCumaMPfVnnp6jgjsp7UNYYgvouDVRCuWbBivMbMJX 9SF/LrSjDOmGv3Ov+WMG+aZxEDP/LMZ7HfiEo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=kYAarNjT5SwlAg7BPql+vqupk/iSwsXitl/K1A94xYBp8vOy3lEn3Cu0Am5vXcYYZ+ Z5BVvSOqogCt7myFnmlunMJX4rxGeDStWz7pJ0gkkEI4+6EvrOTEHG32MewO/lgKtQWx MaNghPkBBEZ8oGNSApC/gkxcXNeLJIuqAg0U0= Received: by 10.141.197.21 with SMTP id z21mr5483271rvp.75.1226581752977; Thu, 13 Nov 2008 05:09:12 -0800 (PST) Received: by 10.141.87.19 with HTTP; Thu, 13 Nov 2008 05:09:12 -0800 (PST) Message-ID: <510143ac0811130509x279cb5c8re61adb89b4ee5696@mail.gmail.com> Date: Thu, 13 Nov 2008 14:09:12 +0100 From: "Jukka Zitting" To: dev@jackrabbit.apache.org Subject: Re: Comparing by time In-Reply-To: <20472546.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20472546.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On Thu, Nov 13, 2008 at 1:22 AM, pkrishna wrote: > I am trying to do a search based on Modified time. What I am observing is the > time format in the node is different from when I am using a > SimpleDateFormat; For example, in the node the lastModified time is saved as > 2008-11-12T16:46:57.089-07:00. I used SimpleDateFormat using the pattern > yyyy-MM-dd'T'HH:mm:ss.SSSZ which seems to be the closest to the format of > the time in the node. I observed for the same date, the call > SimpleDateFormat.format produces a string which ends with -700 which is > slightly different from -07:00. So my question is how I incorporate into a > query that does an exact match on the date. Is this even possible? The easiest way to format dates using the exact format specified in JSR-170 is to use the following code: Calendar date = ...; session.getValueFactory().getValue(date).getString(); Similarly, you can parse JSR-170 date values like this: String date = ...; session.getValueFactory().getValue(date).getDate(); BR, Jukka Zitting