title: Import date/time field in 'DD/MM/YYYY HH:MM:SS' format in SAS
body: <p>I have a .<code>csv</code> or .<code>txt</code> file which contains a date/timestamp field.
  It looks like 'DD/MM/YYYY  HH:MM:SS' in the CSV file. When I load this file is from a txt instead of .csv I can see there is trailing fractional seconds that .csv file isn't displaying.</p>
  <p>I want the field to be read in as a date/time field <code>'DD/MM/YYYY  HH:MM:SS'</code>  (two spaces between date &amp; time) but cant find the correct format to used.</p>
  <p>I'm trying to format this field into a usable format and have tried multiple format types, such as DATETIME19., ANYDTM etc, and I have also tried the picture format &lt; <a href="https://communities.sas.com/t5/SAS-Data-Management/Timestamp-format-of-YYYY-MM-DD-HH-MM-SS/m-p/314667#M8994" rel="nofollow noreferrer">https://communities.sas.com/t5/SAS-Data-Management/Timestamp-format-of-YYYY-MM-DD-HH-MM-SS/m-p/314667#M8994</a>&gt;</p>
  <p>I currently have the field read in as a character but cant slice the data. Data below is to shown as an example, I'm reading this is from a text file currently.</p>
  <pre><code>
  DATA = '2020-08-24 10:49:17.8653230'
  
  DATA ENTITY;
  INFILE ENT
      DELIMITER='09'x
      DSD
      FIRSTOBS=2
      TRUNCOVER;
  
  FORMAT CreatedOn $19.;
  INPUT CreatedOn $;
  RUN;
  
  OUTPUT = '2020-08-24 10:49:17'
  
  </code></pre>
  <p>I've looked through a lot of online resources and must be missing something as I cant make anything I've tried to work.
  I want the fields to be recognized as a date&amp;time field with the <code>DD/MM/YYYY  HH:MM:SS</code> format instead of a character field.</p>
  <p>I'm running base SAS 9.4.2</p>
  <p>Thanks in advance!</p>