title: DynamoDB table scan based on dates - Java
body: <p>I've got a requirement, in my application, whereby I need to check a DynamoDB table for updates at regular intervals. Precisely, The field I need to check is not the hash key, and therefore I cannot query -- I need to scan.
  The scan filter I am trying to build needs to check a field containing a date (coded as a String in the table), and the logic I am using is the one of asking all records created or updated in the last hour. The snippet I am using is below:</p>
  
  <pre><code> Condition scanFilterCondition = new Condition()
  .withComparisonOperator(ComparisonOperator.BETWEEN.toString())
  .withAttributeValueList(new AttributeValue().withS(new Date(currentTime-3600000).toString()), 
  new AttributeValue().withS(new Date(currentTime).toString()));
  </code></pre>
  
  <p>It seems to be correct, however it seems to always return an empty set so it is ovviously not correct.</p>
  
  <p>I've been googling around to understand why this is not correct, however I haven't found anything around scanning/querying DyanmoDB on dates.</p>
  
  <p>Any ideas on the fault?</p>