title: Sorting a dictionary (with date keys) in Python
body: <p>I have a dictionary. The keys are dates (datetime). I need to sort the dictionary so that the values in the dictionary are sorted by date - so that by iterating through the dictionary, I am processing items in the desired chronological (i.e. date/time) order.</p>
  
  <p>How may I sort such a dictionary by date?</p>
  
  <p>Example:</p>
  
  <pre><code>mydict = { '2000-01-01': {fld_1: 1, fld_2: 42}, '2000-01-02': {fld_1:23, fld_2: 22.17} }
  </code></pre>
  
  <p>Note: I am using strings here instead of datetime, to keep the example simple</p>