title: Finding items between 2 dates using boto3 and dynamodb scan
body: <p>I am in the process of moving my NodeJS backend over to Python3.6.</p>
  
  <p>In NodeJS I was able to use the aws SDK to get items between two dates like so :</p>
  
  <p>```</p>
  
  <pre><code>var now = moment().tz("Pacific/Auckland").format()
  var yesterday = moment().add(-24,"Hours").tz("Pacific/Auckland").format()
  var docClient = new AWS.DynamoDB.DocumentClient();
    var params = {
      TableName : process.env.TableName,
      FilterExpression : '#ts between :val1 and :val2',
      ExpressionAttributeNames: {
          "#ts": "timeStamp",
      },
      ExpressionAttributeValues: {
        ':val1': yesterday,
        ':val2': now
      }
    }
  </code></pre>
  
  <p>```</p>
  
  <p>And this works fine, however the between function in boto3 does not seem to do the same thing.</p>
  
  <p>This is the current code I am using to try get something similar:</p>
  
  <p>```</p>
  
  <pre><code>import boto3
  import time
  from datetime import datetime, timedelta
  from boto3.dynamodb.conditions import Key, Attr
  
  dynamodb = boto3.resource('dynamodb')
  table = dynamodb.Table('table_name')
  
  now = int(datetime.timestamp(datetime.now()))
  three_hours_ago =  int(datetime.timestamp(datetime.now() - timedelta(hours=3)))
  
  fe = Key('timeStamp').between(three_hours_ago,now);
  response = table.scan(
                  FilterExpression=fe
              )
  print(response)
  </code></pre>
  
  <p>```</p>
  
  <p>This returns no items, I am sure that there are items between these two dates.</p>
  
  <p>Any help would be much appreciated.</p>