title: How to format datetime values in columns without to_datetime functions in pandas?
body: <p>I have a dataframe as shown below</p>
  
  <pre><code>df1_new = pd.DataFrame({'person_id': [1, 1, 3, 3, 5, 5],'obs_date': ['7/23/2377  12:00:00 AM', 'NA-NA-NA NA:NA:NA', 'NA-NA-NA NA:NA:NA', '7/27/2277  12:00:00 AM', '7/13/2077  12:00:00 AM', 'NA-NA-NA NA:NA:NA']})
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ih5ow.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ih5ow.png" alt="enter image description here"></a></p>
  
  <p>I would not like to use <code>pd.to_datetime</code> approach because of year constraint (upper limit) it imposes. <a href="https://stackoverflow.com/questions/57550238/elegant-and-efficient-way-retain-date-values-as-is-without-oob-error?noredirect=1#comment101563798_57550238">OOB error here</a></p>
  
  <p>The below is what I tried but it isn't efficient as you can see below</p>
  
  <pre><code>yr = df1_new['obs_date'][0][5:9]
  m = df1_new['obs_date'][0][2:4]
  d = df1_new['obs_date'][0][0]
  t = df1_new['obs_date'][0][11:19]
  output = yr + "-" + m + "-" + d + " " + t
  </code></pre>
  
  <p>Is there any other efficient and elegant way to achieve the below expected output without using <code>pd.datetime</code> functions</p>
  
  <p><a href="https://i.stack.imgur.com/oirQQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oirQQ.png" alt="enter image description here"></a></p>
  
  <p><strong>updated screenshot</strong></p>
  
  <p><a href="https://i.stack.imgur.com/q9LEg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q9LEg.png" alt="enter image description here"></a></p>
  
  <p><strong>try/except screenshot</strong></p>
  
  <p><a href="https://i.stack.imgur.com/c57eF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c57eF.png" alt="enter image description here"></a></p>