<?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: Convert start time to a differ time in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459118#M70204</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
starttime='29Apr18 22:30:00'dt;
if timepart(starttime)='22:30't then starttime=dhms(datepart(intnx('dtDay', starttime, 1)),8,0,0);
 format starttime datetime20.;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 May 2018 21:22:53 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-05-01T21:22:53Z</dc:date>
    <item>
      <title>Convert start time to a differ time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459107#M70201</link>
      <description>I have a table that has a start time which is a datetime field ... I need to convert the start time to a morning time if the original eq 22:30. I need it to change time to 08:00 and day would be the following day&lt;BR /&gt;For example&lt;BR /&gt;&lt;BR /&gt;Start time new time&lt;BR /&gt;29Apr18 22:30:00. 30Apr18 08:00:00&lt;BR /&gt;&lt;BR /&gt;29Apr18 01:00:00. 30Apr18 08:00:00</description>
      <pubDate>Tue, 01 May 2018 21:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459107#M70201</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2018-05-01T21:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert start time to a differ time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459110#M70202</link>
      <description>The start time could vary anyyhing = greater than 22:30</description>
      <pubDate>Tue, 01 May 2018 21:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459110#M70202</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2018-05-01T21:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert start time to a differ time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459118#M70204</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
starttime='29Apr18 22:30:00'dt;
if timepart(starttime)='22:30't then starttime=dhms(datepart(intnx('dtDay', starttime, 1)),8,0,0);
 format starttime datetime20.;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 21:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459118#M70204</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-01T21:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert start time to a differ time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459125#M70205</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117620"&gt;@Gil_&lt;/a&gt; wrote:&lt;BR /&gt;The start time could vary anyyhing = greater than 22:30&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But your example&lt;/P&gt;
&lt;PRE&gt;29Apr18 01:00:00. 30Apr18 08:00:00&lt;/PRE&gt;
&lt;P&gt;I much less than 22:30. Was that a typo of some flavor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Possibly intending&lt;/P&gt;
&lt;PRE&gt;  30Apr18 01:00:00. 30Apr18 08:00:00&lt;/PRE&gt;
&lt;P&gt;Which would likely mean that your rule is "any time after 22:30 on one day gets advanced to 08:00 the next day&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; and any time prior to 08:00 gets set to 08:00 for the same day".&lt;/P&gt;
&lt;P&gt;Example of the above rule:&lt;/P&gt;
&lt;PRE&gt;data want;
   input starttime datetime.;
   format starttime datetime.;
   if timepart(starttime) ge '22:30't then wanttime=dhms(datepart(starttime)+1,8,0,0);
   else if timepart(starttime) &amp;lt; '08:00't then wanttime=dhms(datepart(starttime),8,0,0);
   else wanttime=starttime;
   format wanttime datetime.;
datalines;
29Apr18:22:30:00
30Apr18:01:00:00
30Apr18:12:00:00
;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 21:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459125#M70205</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-01T21:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Convert start time to a differ time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459127#M70206</link>
      <description>Thank you</description>
      <pubDate>Tue, 01 May 2018 21:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Convert-start-time-to-a-differ-time/m-p/459127#M70206</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2018-05-01T21:48:39Z</dc:date>
    </item>
  </channel>
</rss>

