<?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 Calculate Time Difference from Datetime Values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-Time-Difference-from-Datetime-Values/m-p/870089#M343683</link>
    <description>&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;P&gt;I am struggling! Ive been working with SAS for a few weeks now, learning new stuff every day and it feels great. I'm stuck at the moment.&lt;/P&gt;
&lt;P&gt;I have two columns of datetimes (format datetime16.) And I want to subtract the second column from the first to calculate the cycle time between both of them in hh:mm format (the cycle time range is very large... ie. ranging from zero minutes to 2000 hours or larger)&lt;/P&gt;
&lt;P&gt;I can't for the life understand what the best method to do this. I have 275,000 rows of data.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 17 Apr 2023 06:53:44 GMT</pubDate>
    <dc:creator>prantsaga</dc:creator>
    <dc:date>2023-04-17T06:53:44Z</dc:date>
    <item>
      <title>Calculate Time Difference from Datetime Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-Time-Difference-from-Datetime-Values/m-p/870089#M343683</link>
      <description>&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;P&gt;I am struggling! Ive been working with SAS for a few weeks now, learning new stuff every day and it feels great. I'm stuck at the moment.&lt;/P&gt;
&lt;P&gt;I have two columns of datetimes (format datetime16.) And I want to subtract the second column from the first to calculate the cycle time between both of them in hh:mm format (the cycle time range is very large... ie. ranging from zero minutes to 2000 hours or larger)&lt;/P&gt;
&lt;P&gt;I can't for the life understand what the best method to do this. I have 275,000 rows of data.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Apr 2023 06:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-Time-Difference-from-Datetime-Values/m-p/870089#M343683</guid>
      <dc:creator>prantsaga</dc:creator>
      <dc:date>2023-04-17T06:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Time Difference from Datetime Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-Time-Difference-from-Datetime-Values/m-p/870090#M343684</link>
      <description>&lt;P&gt;I moved your post to a new topic. Please do not attach questions to resolved topics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a simple subtraction, and assign a suitable format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;diff = time2 - time1; /* results in the difference in seconds */
format diff time8.; /* displays in human-readable form */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Apr 2023 06:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-Time-Difference-from-Datetime-Values/m-p/870090#M343684</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-17T06:59:19Z</dc:date>
    </item>
  </channel>
</rss>

