<?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: Computing difference of two dates in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73478#M7299</link>
    <description>Dates are the number of days from 1/1/1960.&lt;BR /&gt;
Date-Times are the number of seconds from midnight on 1/1/1960.&lt;BR /&gt;
&lt;BR /&gt;
Date1-Date2 = number of days from date2 to date 1.&lt;BR /&gt;
DateTime1-DateTime2 = number of seconds between the two.&lt;BR /&gt;
&lt;BR /&gt;
There are at least two ways to get days from datetime1 and datetime2:&lt;BR /&gt;
&lt;BR /&gt;
datepart(datetime1) - datepart(datetime2) yields the number of days (dropping off the times).&lt;BR /&gt;
&lt;BR /&gt;
(datetime1-datetime2)/(60*60*24) yields days that have a decimal component.</description>
    <pubDate>Wed, 11 Feb 2009 00:30:40 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2009-02-11T00:30:40Z</dc:date>
    <item>
      <title>Computing difference of two dates</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73477#M7298</link>
      <description>I am new to SAS and I am not familiar with how it handles dates.&lt;BR /&gt;
&lt;BR /&gt;
When the difference of two dates is computed, what is the output in the form of?  The default is integer, but I do not know what it represents.  &lt;BR /&gt;
&lt;BR /&gt;
For example:&lt;BR /&gt;
&lt;BR /&gt;
12DEC2005:13:00:00 - 07DEC2005:00:00:00 = 478800&lt;BR /&gt;
&lt;BR /&gt;
If I format the computed column to be date it gives me a non-sense value (at least non-sense to me).  &lt;BR /&gt;
&lt;BR /&gt;
Is there a conversion I should perform to get the value into days?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance for the help.</description>
      <pubDate>Tue, 10 Feb 2009 16:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73477#M7298</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-10T16:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Computing difference of two dates</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73478#M7299</link>
      <description>Dates are the number of days from 1/1/1960.&lt;BR /&gt;
Date-Times are the number of seconds from midnight on 1/1/1960.&lt;BR /&gt;
&lt;BR /&gt;
Date1-Date2 = number of days from date2 to date 1.&lt;BR /&gt;
DateTime1-DateTime2 = number of seconds between the two.&lt;BR /&gt;
&lt;BR /&gt;
There are at least two ways to get days from datetime1 and datetime2:&lt;BR /&gt;
&lt;BR /&gt;
datepart(datetime1) - datepart(datetime2) yields the number of days (dropping off the times).&lt;BR /&gt;
&lt;BR /&gt;
(datetime1-datetime2)/(60*60*24) yields days that have a decimal component.</description>
      <pubDate>Wed, 11 Feb 2009 00:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73478#M7299</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-02-11T00:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Computing difference of two dates</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73479#M7300</link>
      <description>Thank you Doc@Duke for the help</description>
      <pubDate>Wed, 11 Feb 2009 18:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Computing-difference-of-two-dates/m-p/73479#M7300</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-11T18:28:13Z</dc:date>
    </item>
  </channel>
</rss>

