<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert string like 2023-10-02 14:44:07 into a datetime format in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914212#M44256</link>
    <description>&lt;P&gt;october 02&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2024 14:22:53 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2024-02-02T14:22:53Z</dc:date>
    <item>
      <title>How to convert string like 2023-10-02 14:44:07 into a datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914205#M44254</link>
      <description>&lt;P&gt;How to convert string variable startdate like 2023-10-02 14:44:07 into a datetime format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 13:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914205#M44254</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-02-02T13:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert string like 2023-10-02 14:44:07 into a datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914210#M44255</link>
      <description>&lt;P&gt;Does this string represent October 2 or February 10, or do you want SAS to make that choice for you?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 14:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914210#M44255</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-02-02T14:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert string like 2023-10-02 14:44:07 into a datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914212#M44256</link>
      <description>&lt;P&gt;october 02&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 14:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914212#M44256</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-02-02T14:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert string like 2023-10-02 14:44:07 into a datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914218#M44257</link>
      <description>&lt;P&gt;assuming the date time strings have consistent formatting&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    dt='2023-10-02 14:44:07';
run;
data want;
    set have;
    dt_num=input(dt,YMDDTTM.);
    format dt_num datetime.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2024 14:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914218#M44257</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-02T14:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert string like 2023-10-02 14:44:07 into a datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914226#M44258</link>
      <description>&lt;P&gt;if you want to read it directly into a SAS datetime variable, you can avoid reading the data as a string and then creating a second numerical variable. Here's how to read data directly. If you are not familiar with the ANYDTTM&lt;EM&gt;w&lt;/EM&gt;. informat, you can read about the ANY* informats at&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2016/11/11/anydtdte-informat-read-any-date-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/11/11/anydtdte-informat-read-any-date-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dlm=',' dsd truncover; /* comma-separated input */
informat dt anydtdtm.;                  /* read directly into datetime; default width=19 */
format   dt datetime.;                  /* format as datetime, too! */
input dt amount;
datalines;
2020-10-20  4:32:10,  1234.56
2023-10-02 14:44:07, 54321.00
2023-12-31 23:59:59,   876.54
;
proc print; run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2024 15:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-string-like-2023-10-02-14-44-07-into-a-datetime/m-p/914226#M44258</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-02-02T15:25:35Z</dc:date>
    </item>
  </channel>
</rss>

