title: How to get workitem based on modified date and time using RTC Java API
body: <p>I want to query RTC with modified date.
  My query is to check modified date is same as given date and time but the response that I am getting is based on given date and it is ignoring time.</p>
  
  <p>Response:</p>
  
  <blockquote>
    <p>Queried Date: 08/07/2015 15:44:09</p>
    
    <p>Id: 2583 Modified date :2015-08-07 14:43:19.157</p>
    
    <p>Id: 2582 Modified date :2015-08-07 14:43:19.419</p>
  </blockquote>
  
  <p>Ideally, both the records should not be received in response as it is before given time.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>IQueryableAttributeFactory factory = QueryableAttributes.getFactory( IWorkItem.ITEM_TYPE ); 
  
  IQueryableAttribute recAttr1 = factory.findAttribute(projectArea, IItem.MODIFIED_PROPERTY, auditableClient, null ); 
  IQueryableAttribute recAttr2 = factory.findAttribute(projectArea, IWorkItem.TYPE_PROPERTY, auditableClient, null );     
  
  Date date = new Date();
  date.setDate(date.getDate()-6);
  DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
  String reportDate = df.format(date);
  System.out.println("Date: "+reportDate);
  Timestamp timeStamp = new Timestamp(date.getTime()); 
  
  AttributeExpression recExpr1 = new AttributeExpression(recAttr1, AttributeOperation.EQUALS, timeStamp ); 
  
  Term term= new Term(Operator.AND); 
  term.add(recExpr1); 
  
  IQueryClient queryClient = (IQueryClient) teamRepository.getClientLibrary(IQueryClient.class); 
  IQueryResult&lt;IResolvedResult&lt;IWorkItem&gt;&gt; result = queryClient.getResolvedExpressionResults(projectArea, (Expression)term, IWorkItem.FULL_PROFILE); 
  System.out.println("This is total number: "+result.getResultSize(monitor).getTotal()+"\n");                 
  
  while(result.hasNext(null)){ 
      IResolvedResult&lt;IWorkItem&gt; resolvedWorkItem = result.next(null); 
      IWorkItem workItem = resolvedWorkItem.getItem();
      Date date1 = resolvedWorkItem.getItem().modified(); 
      System.out.println("Id: "+workItem.getId());
      System.out.println("Modified date :"+date1.toString()+"\n"); 
  }   
  </code></pre>
  
  <p>Can I get result not only based on date but also on time?</p>
  
  <p>I strongly feel that the back-end logic of RTC is completely ignoring time and querying database only based on date.</p>