title: How to convert 15 Sep 2018 12:00 character to Datetime?
body: <p>I am currently trying to convert data that is in:</p>
  
  <blockquote>
    <p>15 Sep 2018 12:00:00</p>
  </blockquote>
  
  <p>Character to Datetime.</p>
  
  <p>I have managed to successfully convert Character </p>
  
  <blockquote>
    <p>15/08/2018 12:00</p>
  </blockquote>
  
  <p>to Datetime but not </p>
  
  <blockquote>
    <p>15 Sep 2018 12:00</p>
  </blockquote>
  
  <p>The data was originally in Excel. When I load 15/08/2018 12:00 in, I will get numbers such as (Numbers May differ)</p>
  
  <pre><code>42541.843148148
  
  
  
  
  
   &gt; Here is my code(when Character is 15/08/2018 12:00(WORKING)
      &gt; 
      &gt; data have;  
      &gt; input exl_dt;  
      &gt; format date date9.;  
      &gt; format time timeampm.;
      &gt; format dt datetime21.;  
      &gt; date=int(exl_dt)-21916; 
      &gt; time=(exl_dt-int(exl_dt))*60*60*24;  
      &gt; dt=date*24*60*60+time; cards;
      &gt; 42541.843148148 ;
  </code></pre>
  
  <p>However, I am reading another excel now but my character date is now:</p>
  
  <blockquote>
    <p>15 Sep 2018 12:00</p>
  </blockquote>
  
  <p>The same code above will not be able to convert the value to datetime and only produce blank value.</p>
  
  <p>Code for you to try:</p>
  
  <pre><code>data have ;
    datestring = "15 Sep 2018 12:00" ;
  run ;
  </code></pre>
  
  <p>How should i handle this?</p>