<?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: Time Conversion in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158862#M31013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;*char datetime;&lt;/P&gt;&lt;P&gt;a='8/30/2013 10:10:33 PM';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*convert to sas datetime using input;&lt;/P&gt;&lt;P&gt;b=input(a, mdyampm22.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*split to date and time;&lt;/P&gt;&lt;P&gt;date = datepart(b);&lt;/P&gt;&lt;P&gt;time= timepart(b);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*whatever format you wish to apply;&lt;/P&gt;&lt;P&gt;format b datetime. date ddmmyy10. time time8.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 16:28:35 GMT</pubDate>
    <dc:creator>HBruun</dc:creator>
    <dc:date>2014-08-14T16:28:35Z</dc:date>
    <item>
      <title>Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158855#M31006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is my initial data set&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1 EFY.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7051_1 EFY.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my program that will separate date and time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; FINAL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;RAW&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; start_dT &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; start_Time &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;time8.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; end_dT &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; end_Time &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;time8.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; start_dT = INPUT(SUBSTR(dt_start,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; start_time = INPUT(SCAN(dt_start ,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;)||SCAN(dt_start ,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;time.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; End_dT = INPUT(SUBSTR(dt_end,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt; End_time = INPUT(SCAN(dt_end ,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;)||SCAN(dt_end ,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New', serif;"&gt;&lt;STRONG style="background: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;) ,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;time.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; background: #ffffff; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;However, there seems to be a problem with the program. Please refer to below image&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;IMG alt="2 EFY.PNG" class="jive-image-thumbnail jive-image" height="45" src="https://communities.sas.com/legacyfs/online/7052_2 EFY.PNG" style="height: 45px; width: 750px;" width="750" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;Error: The value of start_time should be 22:10:33 but it returns a value of 10:10:33. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;May I know how to fix this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 07:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158855#M31006</guid>
      <dc:creator>01SASUser</dc:creator>
      <dc:date>2014-08-13T07:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158856#M31007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The time. informat doesn't (unfortunately) handle AM/PM, nor does anydttme.&lt;/P&gt;&lt;P&gt;Your option can be to handle this by code (scan for PM, then add 12*60*60 seconds to the result), or concatenate the back the date (in DDMmmYYYY format) and then use MDYAMPM. informat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 08:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158856#M31007</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-08-13T08:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158857#M31008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I wouldn't do this the way you are doing it. Its much safer to use the functions and formats provided by SAS to get the parts:&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; attrib mdate format=mdyampm25.;&lt;BR /&gt;&amp;nbsp; infile datalines;&lt;BR /&gt;&amp;nbsp; input mdate mdyampm25.;&lt;BR /&gt;datalines;&lt;BR /&gt;09-15-08 03:53:00 PM&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp; attrib date format=date9. time format=time5.;&lt;BR /&gt;&amp;nbsp; date=datepart(mdate);&lt;BR /&gt;&amp;nbsp; time=timepart(mdate);&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 08:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158857#M31008</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-13T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158858#M31009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI time INFORMAT but for the OPs problem MDYAMPM is the preferred method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_null_&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; t = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'09:09:09 am'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'09:09:09 pm'&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = input(t,&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;time12.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; r &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;time.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_all_&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;)(=);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;t=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; am r=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;9&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;t=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; pm r=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;21&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;09&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 10:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158858#M31009</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-08-13T10:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158859#M31010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;picture myfmt&amp;nbsp; low-high= '%m/%d/%Y %I:%0M:%0S %P'&amp;nbsp; (DATATYPE=DATETIME);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;input dt_start&amp;nbsp; &amp;amp;&amp;nbsp; mdyampm25.&amp;nbsp; dt_end mdyampm25.;&lt;/P&gt;&lt;P&gt;format&amp;nbsp; dt_start&amp;nbsp; dt_end&amp;nbsp; myfmt.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;8/30/2013 10:10:33PM&amp;nbsp;&amp;nbsp; 8/31/2013 3:38:49PM&lt;/P&gt;&lt;P&gt;8/30/2013 10:10:35PM&amp;nbsp;&amp;nbsp; 9/01/2013 7:18:46PM&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new1;&lt;/P&gt;&lt;P&gt;set new;&lt;/P&gt;&lt;P&gt;date_start= put(datepart(dt_start),mmddyy10.);&lt;/P&gt;&lt;P&gt;time_start= put(timepart(dt_start),time8.);&lt;/P&gt;&lt;P&gt;date_end= put(datepart(dt_end),mmddyy10.);&lt;/P&gt;&lt;P&gt;time_end= put(timepart(dt_end),time8.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 11:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158859#M31010</guid>
      <dc:creator>Vix</dc:creator>
      <dc:date>2014-08-13T11:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158860#M31011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I revised my program by changing time. to time12. :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; FINAL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #0000ff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;RAW&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; start_dT &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; start_Time &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;time12.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; end_dT &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt; end_Time &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;time12.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;start_dT = INPUT(SUBSTR(dt_start,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;start_time = INPUT(SCAN(dt_start ,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #800080;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;)||SCAN(dt_start ,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #800080;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;time12.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;End_dT = INPUT(SUBSTR(dt_end,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;End_time = INPUT(SCAN(dt_end ,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #800080;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;)||SCAN(dt_end ,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #800080;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;) ,&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #008080;"&gt;time12.&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff; font-style: inherit; font-size: 10pt; background-color: #ffffff; font-family: 'Courier New', serif;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff; font-style: inherit; font-size: 10pt; background-color: #ffffff; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New', serif; color: #000000;"&gt;10:00:00 PM now became 22:00:00. My question is will this program won't have any "glitch". Because in my previous program the time from 10:00:00 PM to 12:59:59PM produce a result of 10:00:00 to 12:59:59 instead of 22:00:00 to 00:59:59. But right now I get &lt;SPAN style="color: #000000; font-family: 'Courier New', serif; background-color: #ffffff;"&gt;22:00:00 to 00:59:59&lt;/SPAN&gt;. I just want to be sure that my new program has now "glitch". &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff; font-family: 'Courier New', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 08:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158860#M31011</guid>
      <dc:creator>01SASUser</dc:creator>
      <dc:date>2014-08-14T08:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158861#M31012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of the time12 format you may want the TIMEAMPM11 format to display AM / PM as your previous program did.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 15:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158861#M31012</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-14T15:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158862#M31013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;*char datetime;&lt;/P&gt;&lt;P&gt;a='8/30/2013 10:10:33 PM';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*convert to sas datetime using input;&lt;/P&gt;&lt;P&gt;b=input(a, mdyampm22.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*split to date and time;&lt;/P&gt;&lt;P&gt;date = datepart(b);&lt;/P&gt;&lt;P&gt;time= timepart(b);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*whatever format you wish to apply;&lt;/P&gt;&lt;P&gt;format b datetime. date ddmmyy10. time time8.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 16:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Conversion/m-p/158862#M31013</guid>
      <dc:creator>HBruun</dc:creator>
      <dc:date>2014-08-14T16:28:35Z</dc:date>
    </item>
  </channel>
</rss>

