<?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: Date time format conversation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621287#M182636</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182470"&gt;@helannivas88&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset where the datetime column stored as 'DDMONYYYY:HH:MI:SS.mmmmmm'. I want to format to 'YYYY-MM-DD:HH:MI:SS.mmmmmm'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried with format as&amp;nbsp;e8601dt19. But i got output as '2019-05-20T11:03:22'. I dont want to have T in my output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any other format that can be used to get the desired output. Thanks in Advance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think datetime. is the format you want. Depending on how many decimal places you want after the seconds, you could use datetime19.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 19:24:14 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-01-30T19:24:14Z</dc:date>
    <item>
      <title>Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621275#M182628</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset where the datetime column stored as 'DDMONYYYY:HH:MI:SS.mmmmmm'. I want to format to 'YYYY-MM-DD:HH:MI:SS.mmmmmm'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried with format as&amp;nbsp;e8601dt19. But i got output as '2019-05-20T11:03:22'. I dont want to have T in my output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other format that can be used to get the desired output. Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621275#M182628</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-01-30T18:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621287#M182636</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182470"&gt;@helannivas88&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset where the datetime column stored as 'DDMONYYYY:HH:MI:SS.mmmmmm'. I want to format to 'YYYY-MM-DD:HH:MI:SS.mmmmmm'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried with format as&amp;nbsp;e8601dt19. But i got output as '2019-05-20T11:03:22'. I dont want to have T in my output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any other format that can be used to get the desired output. Thanks in Advance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think datetime. is the format you want. Depending on how many decimal places you want after the seconds, you could use datetime19.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 19:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621287#M182636</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-30T19:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621296#M182641</link>
      <description>&lt;P&gt;This is a case where I think you will have to define your own format.&amp;nbsp; In particular use the PICTURE statement (in PROC FORMAT) with the option (DATATYPE=DATETIME).&amp;nbsp; This will allow you to use "directives" (the % characters below) to specify year, month, day, hour, minutes, second as well as the colon and dash separators.&amp;nbsp; You can learn more in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The "datatype" and "directives" parts of&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Picture Statement&lt;/A&gt; , and&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n01lvjtpz3ewuhn1cvj3x4yhzyul.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Example 7: Change the 24–Hour Clock to 00:00:01–24:00:00&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here's what you probably can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
  picture myfmt  
   other= '%Y-%0m-%0d:%0H:%0M:%0S' (datatype=datetime );
run;

data _null_;
   x='20may2019:11:03:22'dt;
   put x=datetime20.  /
       x=e8601dt19.   /
       x=myfmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2020 19:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/621296#M182641</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-01-30T19:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623423#M183540</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;for the picture format. But using the format , Im unable to derive the microseconds(or) milli seconds&lt;/P&gt;
&lt;P&gt;For Eg:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; picture myfmt&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; other&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'%Y-%0m-%0d:%0H:%0M:%0S'&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;datatype&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;datetime&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;x&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'08FEB2020:18:29:00.000000'dt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; x=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;datetime27.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; /&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; x=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;e8601dt19.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; /&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; x=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;myfmt.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;I'm not getting output as 2020-02-08 18:29:00.000000. I tried the picture format as &lt;SPAN class="token string"&gt;'%Y-%0m-%0d:%0H:%0M:%000000S'&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;datatype&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;datetime&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;) (or) &lt;SPAN class="token string"&gt;'%Y-%0m-%0d:%0H:%0M:%0S.nnnnnn'&lt;/SPAN&gt; (datatype&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;datetime&lt;/SPAN&gt; ) , but nothing works.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN class="token punctuation"&gt;Please let me know if we are able to get the desired output. Thanks in Advance.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 17:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623423#M183540</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-02-09T17:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623427#M183543</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;I have changed like below and it worked perfectly.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;picture&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; myfmt &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; other= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'%Y-%0m-%0d %0H:%0M:%0s'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datatype&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=datetime );&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;x&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'08FEB2020:18:29:00.022020'dt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; x=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;myfmt26.6&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 17:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623427#M183543</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-02-09T17:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date time format conversation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623434#M183546</link>
      <description>Cool!&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Feb 2020 18:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-format-conversation/m-p/623434#M183546</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-02-09T18:44:03Z</dc:date>
    </item>
  </channel>
</rss>

