From dev-return-20849-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Nov 13 17:51:16 2008 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 21619 invoked from network); 13 Nov 2008 17:51:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2008 17:51:16 -0000 Received: (qmail 56929 invoked by uid 500); 13 Nov 2008 17:51:22 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 56895 invoked by uid 500); 13 Nov 2008 17:51:22 -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 56883 invoked by uid 99); 13 Nov 2008 17:51:22 -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 09:51:22 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of monkiki@gmail.com designates 74.125.44.29 as permitted sender) Received: from [74.125.44.29] (HELO yx-out-2324.google.com) (74.125.44.29) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 17:50:01 +0000 Received: by yx-out-2324.google.com with SMTP id 8so459849yxm.1 for ; Thu, 13 Nov 2008 09:50:34 -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:sender :to:subject:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=rWx6GUBlT5GXsI5s0Q4v+OCksRBW1EsGhLGhmCrXKcs=; b=pcOd6R8RYrhgR25yYGgLV1wRyyktRUZcJ3Dhg9ciJZ+36dNg0R0Sz+KhpGY0qHefjq l5EY0qI+RQMoc3TzXRARVmklew9ef7p9W5eXrDpdJkPw7JihNtBeu2NLHNfTxMNIGNJT Gv5usL6kDOJ48wP2KxJk5Wh7Z+xW6Lp/FuXbk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=tHJUbC3xGW26GC7J+emXFOfkTTs4A/oRVQ7q8MnArJI8ZTb40wNJ/azzNWw0R86+2Y prn9cJVxqkNsdXtarOULCQWDmcR4KMrFTqRFazye4CuS7mYsbPulr1mBEuBx0X9CYC4g RGLPzv7xUxUvjNr163llyH887BYDzaDDqijNU= Received: by 10.101.70.15 with SMTP id x15mr4844135ank.112.1226598634498; Thu, 13 Nov 2008 09:50:34 -0800 (PST) Received: by 10.100.12.13 with HTTP; Thu, 13 Nov 2008 09:50:34 -0800 (PST) Message-ID: <8f70390811130950sbde4727u51fe4bed1bd0a2b3@mail.gmail.com> Date: Thu, 13 Nov 2008 18:50:34 +0100 From: "Paco Avila" Sender: monkiki@gmail.com To: dev@jackrabbit.apache.org Subject: Re: Comparing by time In-Reply-To: <510143ac0811130509x279cb5c8re61adb89b4ee5696@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_31109_22543393.1226598634496" References: <20472546.post@talk.nabble.com> <510143ac0811130509x279cb5c8re61adb89b4ee5696@mail.gmail.com> X-Google-Sender-Auth: ed7323bccd1ce63d X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_31109_22543393.1226598634496 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Use "org.apache.jackrabbit.util.ISO8601" for date format. On Thu, Nov 13, 2008 at 2:09 PM, Jukka Zitting wrote: > 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 > -- Paco Avila GIT Consultors tel: +34 971 498310 fax: +34 971496189 e-mail: pavila@git.es http://www.git.es ------=_Part_31109_22543393.1226598634496--