title: ValueError: invalid literal for int() with base 10: 'da'
body: <p>I keep getting the same ValueError for the following code and I am having a hard time understanding why the error is being generated.  It is my understanding that this error is generated when the wrong value is passed into a function, however, I do not really understand what this error is telling me.  I've spent time searching online and in the docs, but I am unable to understand what I am doing wrong.  Simply, why is this error being generated?</p>
  
  <p>My code:</p>
  
  <pre><code>import datetime
  import ystockquote
  
  def new_time(n):
      fmt = "%Y%m%d"
      end_date1 = datetime.datetime.strptime(n, fmt)
      sixty_day = datetime.timedelta(days=60)
      start_date  = end_date1 - sixty_day
      start_date1 = str(start_date)
      start_date2 = start_date1[:4] + start_date1[5:7] + start_date1[8:10]
      return start_date2
  
  def average_atr():
      print "Enter your stock symbol: "
      symbol      = raw_input(" ")
      print "Enter the end date in (YYYYMMDD) format: "
      end_date    = raw_input(" ")
      start_date  = new_time(end_date)
      initial_list = ystockquote.get_historical_prices('symbol', 'start_date', 'end_date')
  
  def start():
      average_atr()
  
  start()
  </code></pre>
  
  <p>This is the relevant code for ystockquote:</p>
  
  <pre><code>def get_historical_prices(symbol, start_date, end_date):
      """
      Get historical prices for the given ticker symbol.
      Date format is 'YYYYMMDD'
  
      Returns a nested list.
      """
      url = 'http://ichart.yahoo.com/table.csv?s=%s&amp;' % symbol + \
            'd=%s&amp;' % str(int(end_date[4:6]) - 1) + \
            'e=%s&amp;' % str(int(end_date[6:8])) + \
            'f=%s&amp;' % str(int(end_date[0:4])) + \
            'g=d&amp;' + \
            'a=%s&amp;' % str(int(start_date[4:6]) - 1) + \
            'b=%s&amp;' % str(int(start_date[6:8])) + \
            'c=%s&amp;' % str(int(start_date[0:4])) + \
            'ignore=.csv'
      days = urllib.urlopen(url).readlines()
      data = [day[:-2].split(',') for day in days]
      return data
  </code></pre>
  
  <p>Please note that the ystockquote code above is not the complete code.</p>