Hi,

On Thu, Apr 24, 2008 at 8:40 PM, AnupChatterjee
<[EMAIL PROTECTED]> wrote:
>  I'm trying to query the repository for all the modified nodes under nt:file
>  changed since a particular TimeStamp
>
>  The problem I'm having is with querying with the right format of
>  lastModified
>  I have tried the XPATH query -
>  "//element(*, nt:file)/[EMAIL PROTECTED]:lastModified > " + sqlTimestamp + 
> "]"
>
>  java.sql.TimeStamp.toString as well as getTime() which returns long
>  millsecs. Any ideas on what the right format is

The easiest way to get the correct date format is the Value.getString() method:

    Calendar timestamp = ...;
    Value value = session.getValueFactory().createValue(timestamp);
    String xpath = "//[EMAIL PROTECTED]:lastModified > xs:dateTime('" +
value.getString() + "')]";

BR,

Jukka Zitting

Reply via email to