title: Python 3.x How to find the youngest files based on filename 4000+ files
body: <p>I'm trying to find all the youngest files in a folder based on the filename, i have over 4000 backup files from various site locations with different dates in the filename (see below).</p>
  <p><strong>Sample filename:</strong> <em>location-model-extra-MMM-DD-YY-HH-MM-SSS</em></p>
  <p>e.g. xxxx-xx (sitename) is not consistent so can't use character counting and &quot;-&quot; dashes vary due to names, so very inconsistent. The only consistent part is the date using this format <em>MMM-DD-YY</em></p>
  <pre><code> \pathto\Dir\
  
  xxx-xx-xx-Apr-24-20-3-29-22
  xxx-xx-xx-Feb-2-07-3-22-02-33-40
  xxx-xx-xx-Jul-24-20-19-20-11
  yyyyyyy-yy-Apr-24-20-3-29-22
  yyyyyyy-yy-Feb-2-07-3-22-02-33-40
  yyyyyyy-yy-Jul-24-20-19-20-11
  ZZ-zz-zZzZZZZZZZ-Apr-24-20-3-29-22
  ZZ-zz-zZzZZZZZZZ-Feb-2-07-3-22-02-33-40
  ZZ-zz-zZzZZZZZZZ-Jul-24-20-19-20-11
  
  What I'm trying to find is: 
  
  xxx-xx-xx-Jul-24-20-19-20-11
  yyyyyyy-yy-Jul-24-20-19-20-11
  ZZ-zz-zZzZZZZZZZ-Jul-24-20-19-20-11
  </code></pre>
  <p>This is what I have tried but its limited to just returning the over all youngest, was also looking at Dictionaries but don't know how they work for this. So currently stuck on the next steps.</p>
  <pre><code>filelist = glob.glob(path) 
  
  # print youngest / oldests
  list_of_files = glob.glob(path) # * means all if need specific format then *.csv
  latest_file = max(list_of_files, key=os.path.getctime)
  print(latest_file)
  </code></pre>
  <p>Thanks for any help in advance</p>