title: YFinance and Datatime Inputs
body: <p>I am having trouble feeding in a date value to the YFinance python module. I keep getting the error that it cannot process the minutes/seconds values and just needs a regular date but I can't figure out how to feed that in.</p>
  <p>Error is &quot;   raise ValueError(&quot;time data %r does not match format %r&quot; %
  ValueError: time data &quot;'2020-12-28'&quot; does not match format '%Y-%m-%d&quot;</p>
  <p>The values print as if they are correct. Table yfinanceinputs holds the below values
  Inputs
  12/28/2020
  12/31/2020
  daily</p>
  <pre><code>SQL_Script2 = &quot;SELECT * FROM yfinanceinputs&quot;
  pos = pd.io.sql.read_sql(SQL_Script2, cnxn)
  
  inputs = pos.loc[:,'Inputs']
  
  start_date = pd.to_datetime(inputs.values[0])
  end_date = pd.to_datetime(inputs.values[1])
  Day1 = pd.to_datetime(start_date).date()
  End = pd.to_datetime(end_date).date()
  Day1 = &quot;'%s'&quot; % Day1
  End = &quot;'%s'&quot; % End
  
  print(Day1)
  print(End)
  
  cnxn.close()
  
  yahoo_financials = YahooFinancials(positions_held)
  data = yahoo_financials.get_historical_price_data(Day1,End,'daily')
  </code></pre>