title: Python time delta
body: <p>Please let me know if I am doing this part correctly. I am trying to grab files ONLY modified in the past 24 hours. However my output is ALL files in the directory regardless of modified time:</p>
  
  <pre><code>yesterday = date.today() - timedelta(days=1)
  dayToStr = yesterday.strftime('%Y%m%d')
  
  file_list_attr = sftp.listdir_attr()
  for file in file_list_attr:
    if  file.st_mtime &lt;= dayToStr:
      print file
  </code></pre>
  
  <p>Output</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>-rw-r--r--   1 4012     60        3404961 09 Jan 18:32 2_YEAR_912828UD0_20130109.dat
        -rw-r--r--   1 4012     60       10206411 09 Jan 18:32 3_YEAR_912828UG3_20130109.dat
        -rw-r--r--   1 4012     60       68311760 09 Jan 18:34 5_YEAR_912828UE8_20130109.dat
        -rw-r--r--   1 4012     60       54215712 09 Jan 18:35 7_YEAR_912828UF5_20130109.dat
        -rw-r--r--   1 4012     60       88014103 09 Jan 18:37 10_YEAR_912828TY6_20130109.dat
        -rw-r--r--   1 4012     60       53565072 09 Jan 18:38 30_YEAR_912810QY7_20130109.dat
        -rw-r--r--   1 4012     60        8527412 04 Jan 18:31 2_YEAR_912828UD0_20130104.dat
        -rw-r--r--   1 4012     60       21659138 04 Jan 18:31 3_YEAR_912828UC2_20130104.dat
        -rw-r--r--   1 4012     60       91281894 04 Jan 18:34 5_YEAR_912828UE8_20130104.dat
        -rw-r--r--   1 4012     60       80421507 04 Jan 18:36 7_YEAR_912828UF5_20130104.dat
        -rw-r--r--   1 4012     60       108700356 04 Jan 18:38 10_YEAR_912828TY6_20130104.dat
        -rw-r--r--   1 4012     60       50204292 04 Jan 18:39 30_YEAR_912810QY7_20130104.dat
        -rw-r--r--   1 4012     60        2319656 07 Jan 18:24 2_YEAR_912828UD0_20130107.dat
        -rw-r--r--   1 4012     60        6978760 07 Jan 18:24 3_YEAR_912828UC2_20130107.dat
        -rw-r--r--   1 4012     60       53579177 07 Jan 18:25 5_YEAR_912828UE8_20130107.dat
        -rw-r--r--   1 4012     60       46069381 07 Jan 18:26 7_YEAR_912828UF5_20130107.dat
        -rw-r--r--   1 4012     60       70802355 07 Jan 18:28 10_YEAR_912828TY6_20130107.dat
        -rw-r--r--   1 4012     60       43050822 07 Jan 18:29 30_YEAR_912810QY7_20130107.dat
        -rw-r--r--   1 4012     60        2713906 08 Jan 18:31 2_YEAR_912828UD0_20130108.dat
        -rw-r--r--   1 4012     60        8889264 08 Jan 18:31 3_YEAR_912828UC2_20130108.dat
        -rw-r--r--   1 4012     60       63857903 08 Jan 18:32 5_YEAR_912828UE8_20130108.dat
        -rw-r--r--   1 4012     60       55544096 08 Jan 18:34 7_YEAR_912828UF5_20130108.dat
        -rw-r--r--   1 4012     60       89750161 08 Jan 18:36 10_YEAR_912828TY6_20130108.dat
        -rw-r--r--   1 4012     60       59233399 08 Jan 18:37 30_YEAR_912810QY7_20130108.dat</p>
      </blockquote>
    </blockquote>
  </blockquote>