title: Timedelta is not defined
body: <p>Below is the code I am working on. From what I can tell there is no issue, but when I attempt to run the piece of code I receive an error.</p>
  
  <pre><code>import os 
  import datetime
  
  def parseOptions():
  
      import optparse
      parser = optparse.OptionParser(usage= '-h')
      parser.add_option('-t', '--type', \
                        choices= ('Warning', 'Error', 'Information', 'All'), \
                        help= 'The type of error',
                        default= 'Warning')
      parser.add_option('-g', '--goback', \
                        type= 'string')
      (options, args) = parser.parse_args()
      return options
  
  options = parseOptions() now = datetime.datetime.now() subtract = timedelta(hours=options.goback) difference = now - subtract
  
  if options.type=='All' and options.goback==24:
      os.startfile('logfile.htm')
  
  else: 
      print
      print 'Type =', options.type,
      print
      print 'Go Back =', options.goback,'hours'
      print difference.strftime("%H:%M:%S %a, %B %d %Y")
      print
  </code></pre>
  
  <p>Error is as followed:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\Lib\SITE-P~1\PYTHON~2\pywin\framework\scriptutils.py", line 325, in RunScript
      exec codeObject in __main__.__dict__
    File "C:\Users\user\Desktop\Python\python.py", line 19, in &lt;module&gt;
      subtract = timedelta(hours=options.goback)
  NameError: name 'timedelta' is not defined
  </code></pre>
  
  <p>Any help would be appreciated.</p>