title: Read a formatted date in Python 2.3?
body: <p>I had never worked with the datetime module in Python 2.3, and I have a very silly problem. I need to read a date in the format </p>
  
  <pre><code>'10-JUL-2010'
  </code></pre>
  
  <p>then subtract a day (I would use <code>timedelta</code>), and return the string </p>
  
  <pre><code>'09-JUL-2010 00:00:00 ET'
  </code></pre>
  
  <p>of course, this is for hundreds of dates. While it should be trivial, I cannot find the info on how to read formatted dates in Python 2.3! Help!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I am able to retrieve the formatted date as a tuple, but it will not accept the <code>timedelta</code> object for subtraction! Still working on it...</p>
  
  <p>** Edit **</p>
  
  <p>Finally... thanks to your help I was able to solve the problem as follows:</p>
  
  <pre><code>print (datetime(*(time.strptime(date_string, format)[0:6])).strftime('%d-%b-%Y')).upper()+'00:00:00 ET'
  </code></pre>