title: Python - How to upload files created today in a folder to S3
body: <p>I have a folder called <code>myfolder</code> containing multiple files with filename as follows,</p>
  
  <pre><code>ID001_2017-04-15.csv, ID002_2017-04-15.csv, ID001_2017-04-16.csv, ID002_2017-04-16.csv, 
  ID001_2017-04-17.csv, ID002_2017-04-17.csv, ID001_2017-04-18.csv, ID002_2017-04-18.csv
  </code></pre>
  
  <p>The date on the filename is the date the file created. For example, file <code>ID001_2017-04-17.csv</code>is created on <em>2017-04-17</em>. Here's how I uploaded all the files in a folder to Amazon S3, </p>
  
  <pre><code>import boto3
  
  def upload_files(path):
      session = boto3.Session(
                aws_access_key_id = 'this is my access key',
                aws_secret_access_key = 'this is my secret key',
                region_name = 'this is my region'
                )
      s3 = session.resource('s3')
      bucket = s3.Bucket('this is my bucket')
  
      for subdir, dirs, files in os.walk(path):
          for file in files:
              full_path = os.path.join(subdir, file)
              with open(full_path, 'rb') as data:
                  bucket.put_object(Key = full_path[len(path) + 1:], Body = data)
  
  if __name__ == "__main__":
      upload_files('path to myfolder') ## Replace this with your folder directory
  </code></pre>
  
  <p>My question is can I only upload files that are created today to Amazon S3?  </p>