title: How to find date values which are more than 10 days old
body: <p>I am using Java and iterating over D.B. column which in return gives me date and time string as shown below:</p>
  
  <pre><code>String dateTime = resultSet.getSeries().get(0).getValues().get(0).get(0);
  </code></pre>
  
  <p>If I iterate on this resultset I am getting dateTime values in format as shown below. </p>
  
  <pre><code>2017-07-20T19:21:37.987792408Z
  2017-04-24T22:04:26.808753375Z
  2017-08-14T22:22:40.340772396Z
  2017-06-24T22:24:32.422544491Z
  2017-07-31T22:27:05.893368615Z
  </code></pre>
  
  <p>Out of these records, how can I compare date string with "current" date object and discard those values which are more than 10 days old?</p>
  
  <p>I tried </p>
  
  <p><code>Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").parse(s);</code> </p>
  
  <p>That didn't work. Any other idea?</p>
  
  <p>Edit: 
  I am using Java7 and using InfluxDB that does not provide sysdate column while querying. So I have to come up with solution using Java.</p>