title: Pandas - Can't cast string to datetime
body: <p>I have a datframe that stores some information from text files, this information gives me details about my execution jobs.</p>
  
  <p>I store all this information in a dataframe called "df_tmp". On that dataframe I have a column "end_Date" where I want to store the end date from the file that is the last line of my file but if in the dataframe I don't have any value I want to store the current_time.</p>
  
  <p>Imagine that the information from my file is on the following variable:</p>
  
  <pre><code>string_from_my_file = 'Execution time at 2019/10/14 08:06:44'
  </code></pre>
  
  <p>What I need is:</p>
  
  <p>In case of my manual file don't have any date on the last line I want to store the current_time.
  For that I am trying with this code:</p>
  
  <pre><code>now = dt.datetime.now()
  current_time = now.strftime('%H:%M:%S')
  df_tmp['end_date'] = df_tmp['end_date'].fillna(current_time).apply(lambda x: x.strftime('%Y-%m-%d %H:%M:%S') if not pd.isnull(x) else pd.to_datetime(re.search("([0-9]{4}\/[0-9]{2}\/[0-9]{2}\ [0-9]{2}\:[0-9]{2}\:[0-9]{2})", str(df_tmp['string_from_my_file']))[0]))  
  </code></pre>
  
  <p>However, it gives me the following error:</p>
  
  <pre><code>builtins.AttributeError: 'str' object has no attribute 'strftime'
  </code></pre>
  
  <p>What I am doing wrong?</p>
  
  <p>Thanks</p>