Use "org.apache.jackrabbit.util.ISO8601" for date format. On Thu, Nov 13, 2008 at 2:09 PM, Jukka Zitting <[EMAIL PROTECTED]>wrote:
> Hi, > > On Thu, Nov 13, 2008 at 1:22 AM, pkrishna <[EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] http://www.git.es
