<?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 do I format a date in the form 2022-02-22 14:34:16 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/800833#M315103</link>
    <description>&lt;P&gt;The solution worked well&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 11:57:42 GMT</pubDate>
    <dc:creator>mmohotsi</dc:creator>
    <dc:date>2022-03-08T11:57:42Z</dc:date>
    <item>
      <title>How do I format a date in the form 2022-02-22 14:34:16</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797790#M313670</link>
      <description>&lt;P&gt;Greetings&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table as attached&lt;/P&gt;
&lt;P&gt;I have used the following code to update the field processed_on with today's date as a datetime&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;Update table1Set PROCESSED_ON = datetime();&lt;BR /&gt;alter table table1 modify PROCESSED_ON integer &lt;BR /&gt;format = datetime16.;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format on the resultant table is of the form 22Feb2022 14:34:16&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I format the date field to start with the year like 2022-02-22 14:34:16&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 12:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797790#M313670</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2022-02-22T12:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a date in the form 2022-02-22 14:34:16</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797791#M313671</link>
      <description>&lt;P&gt;SAS provides a family of formats compliant with the ISO 8601 standard for dates and times.&lt;/P&gt;
&lt;P&gt;If the E8601DT19. format does not suit you because of the "T", roll your own picture format with PROC FORMAT.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 12:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797791#M313671</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-22T12:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a date in the form 2022-02-22 14:34:16</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797833#M313690</link>
      <description>&lt;P&gt;Use (almost 1-to-1) example from the doc:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  picture myDateTime (default=19) 
    other = '%Y-%0m-%0d %0H:%0M:%0S' (datatype=datetime);
  ;
run;

data _null_;
  x = '22Feb2022 14:34:16'dt;
  put x myDateTime.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n01lvjtpz3ewuhn1cvj3x4yhzyul.htm" target="_blank"&gt;(example 7) https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n01lvjtpz3ewuhn1cvj3x4yhzyul.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797833#M313690</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2022-02-22T15:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a date in the form 2022-02-22 14:34:16</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797839#M313694</link>
      <description>&lt;P&gt;You do want to be very careful in SAS thinking "date" when the value is actually a "datetime". The units are not the same and when you apply "date" functions to datetime values you may get very unexpected and often unusable results.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/797839#M313694</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-22T15:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format a date in the form 2022-02-22 14:34:16</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/800833#M315103</link>
      <description>&lt;P&gt;The solution worked well&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 11:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-format-a-date-in-the-form-2022-02-22-14-34-16/m-p/800833#M315103</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2022-03-08T11:57:42Z</dc:date>
    </item>
  </channel>
</rss>

