<?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 date and time functions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567174#M11459</link>
    <description>&lt;P&gt;hi friend,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have one new task i have to convert some data into iso8601 format can any one help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sample;&lt;BR /&gt;input year month date time $;&lt;BR /&gt;cards;&lt;BR /&gt;2014 6 10 08:12&lt;BR /&gt;2014 6 11 08:16&lt;BR /&gt;2014 6 13 08:34&lt;BR /&gt;2014 6 14 08:12&lt;BR /&gt;2014 6 15 08:19&lt;BR /&gt;2014 6 16 08:45&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the data how can i convert into iso8601 format?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2019 09:05:39 GMT</pubDate>
    <dc:creator>ravindra2</dc:creator>
    <dc:date>2019-06-19T09:05:39Z</dc:date>
    <item>
      <title>date and time functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567174#M11459</link>
      <description>&lt;P&gt;hi friend,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have one new task i have to convert some data into iso8601 format can any one help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sample;&lt;BR /&gt;input year month date time $;&lt;BR /&gt;cards;&lt;BR /&gt;2014 6 10 08:12&lt;BR /&gt;2014 6 11 08:16&lt;BR /&gt;2014 6 13 08:34&lt;BR /&gt;2014 6 14 08:12&lt;BR /&gt;2014 6 15 08:19&lt;BR /&gt;2014 6 16 08:45&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the data how can i convert into iso8601 format?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567174#M11459</guid>
      <dc:creator>ravindra2</dc:creator>
      <dc:date>2019-06-19T09:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: date and time functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567191#M11460</link>
      <description>&lt;P&gt;Use the appropriate informat to create a sas datetime variable. Then assign the format iso8601dt to the created variable. Job done.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567191#M11460</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-06-19T09:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: date and time functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567192#M11461</link>
      <description>&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
input year month date time $;
day=input(catx('-',put(date,best.),put(month,best.),put(year,best.)),ddmmyy10.);
date2=put(dhms(day,0,0,input(time,time5.)),E8601DT.);
cards;
2014 6 10 08:12
2014 6 11 08:16
2014 6 13 08:34
2014 6 14 08:12
2014 6 15 08:19
2014 6 16 08:45
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567192#M11461</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-06-19T09:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: date and time functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567330#M11479</link>
      <description>&lt;P&gt;If you can read it in as a TIME instead this becomes fairly easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 

data sample;
input year month date time : time.;
format time time.;
cards;
2014 6 10 08:12
2014 6 11 08:16
2014 6 13 08:34
2014 6 14 08:12
2014 6 15 08:19
2014 6 16 08:45
;



data want;
set sample;

time_want = dhms(mdy(month, date, year), 0, 0, time);
format time_want E8601DT.;
time_want_char = put(time_want, E8601DT.);

run;

proc print;run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you already have time as character you can convert it using the following and then replacing time in the code above with time_num.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;time_num=input(time, time.);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-and-time-functions/m-p/567330#M11479</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-19T15:39:39Z</dc:date>
    </item>
  </channel>
</rss>

