<?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 datetime fields -1day is causing time to be 00:00.00 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24581#M5561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like a date one day away from the value in a datetime field. My new field is getting created with one day subtracted but all of the times are not preserved. They all get set to 00:00:00.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;newdt2=intnx('dtday',datetime(),-1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newdt1=intnx('dtday',mydatetimefield,-1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Oct 2011 14:08:42 GMT</pubDate>
    <dc:creator>LeeJ</dc:creator>
    <dc:date>2011-10-06T14:08:42Z</dc:date>
    <item>
      <title>datetime fields -1day is causing time to be 00:00.00</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24581#M5561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like a date one day away from the value in a datetime field. My new field is getting created with one day subtracted but all of the times are not preserved. They all get set to 00:00:00.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;newdt2=intnx('dtday',datetime(),-1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newdt1=intnx('dtday',mydatetimefield,-1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 14:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24581#M5561</guid>
      <dc:creator>LeeJ</dc:creator>
      <dc:date>2011-10-06T14:08:42Z</dc:date>
    </item>
    <item>
      <title>datetime fields -1day is causing time to be 00:00.00</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24582#M5562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are leaving off one parameter, namely 's', to keep the time the same.&amp;nbsp; i.e.,&lt;/P&gt;&lt;P&gt;&amp;nbsp; newdt2=intnx('dtday',datetime(),-1,'s') ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 14:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24582#M5562</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-06T14:13:22Z</dc:date>
    </item>
    <item>
      <title>datetime fields -1day is causing time to be 00:00.00</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24583#M5563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are doing nothing wrong.&amp;nbsp; Check the "alignment" documentation for intnx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "old fashioned" way to subtract one day from a datetime variable is to simply subtract 1 day's worth of seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newdt = olddt - 24*60*60;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 14:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datetime-fields-1day-is-causing-time-to-be-00-00-00/m-p/24583#M5563</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-10-06T14:16:14Z</dc:date>
    </item>
  </channel>
</rss>

