<?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: datetime function - odd results in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304182#M64726</link>
    <description>&lt;P&gt;Ugh, I had the start code outside of my Rsubmit and the stop code still inside my Rsubmit. &amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2016 19:52:08 GMT</pubDate>
    <dc:creator>buechler66</dc:creator>
    <dc:date>2016-10-12T19:52:08Z</dc:date>
    <item>
      <title>datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302788#M64271</link>
      <description>&lt;P&gt;I run the same code at the beginning of my program and at the end. Basically I want a datetime stamp of when it starts and one for when it ends. I'm getting odd results tho. The datetime at the end of my program is actually earlier then the datetime at the beginning of my program. What am I missing here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4    /*  Datetime stamp of program start */
5        data _null_;
6            dt_stamp = DATETIME();
7            PUT 'Progam Started: ' dt_stamp datetime20.;
8        run;

Progam Started:   05OCT2016:15:37:25
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      user cpu time       0.00 seconds
      system cpu time     0.04 seconds
      memory              179.07k
      OS Memory           7556.00k
      Timestamp           10/05/2016 03:37:24 PM&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;987   /*  Datetime stamp of program stop */
988   data _null_;
989       dt_stamp = DATETIME();
990       PUT 'Progam Stopped: ' dt_stamp datetime20.;
991   run;

Progam Stopped:   05OCT2016:15:19:34
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302788#M64271</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-10-05T20:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302798#M64273</link>
      <description>&lt;P&gt;That is really strange. Maybe try an alternative way with the dhms function and see if you get different results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  day=date();
  time=time();
  dt_stamp=dhms(day,0,0,time);
  PUT 'Progam Started: ' dt_stamp datetime.;
run;
&lt;BR /&gt;data _null_;
  day=date();
  time=time();
  dt_stamp=dhms(day,0,0,time);
  PUT 'Progam Stopped: ' dt_stamp datetime.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 21:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302798#M64273</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-10-05T21:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302810#M64279</link>
      <description>&lt;P&gt;I believe datetime() queries the servers internal clock so what you observe shouldn't be possible. Are you 100% sure that the "stop time" code executed after the "start time" code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only&amp;nbsp;far fetched&amp;nbsp;idea I currently have is that your code runs on a grid, that the two code blocks you've posted ran on different nodes, and that the clocks on the nodes are not in sync&amp;nbsp;(which also shouldn't happen).&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 23:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302810#M64279</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-10-05T23:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302843#M64293</link>
      <description>&lt;P&gt;Is that repeatable or did it happen only once?&lt;/P&gt;
&lt;P&gt;Someone (or something) might simply have reset the server's clock.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 06:01:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/302843#M64293</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-06T06:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304182#M64726</link>
      <description>&lt;P&gt;Ugh, I had the start code outside of my Rsubmit and the stop code still inside my Rsubmit. &amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 19:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304182#M64726</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-10-12T19:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304255#M64756</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/79805"&gt;@buechler66&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Ugh, I had the start code outside of my Rsubmit and the stop code still inside my Rsubmit. &amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means you still have a big issue. All your hosts should be connected to a NTP service, so their clocks are synchronized. Some SAS metadata operations do not work if client and server are more than a few seconds apart.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 06:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304255#M64756</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-13T06:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304328#M64782</link>
      <description>That is good to know. Can you give me an example of such a SAS process&lt;BR /&gt;that would be effected or a link to any docs?&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##&lt;BR /&gt;&lt;BR /&gt;Sent from mobile</description>
      <pubDate>Thu, 13 Oct 2016 11:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304328#M64782</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-10-13T11:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304334#M64787</link>
      <description>&lt;P&gt;Saving an Enterprise Guide project to metadata causes issues (at least with EG 4.3/SAS 9.2) when the clocks of server and client are not within a few seconds. The webdav server then obviously balks at the timestamps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 11:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304334#M64787</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-13T11:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304338#M64788</link>
      <description>Thanks very much. Also, if anyone else knows of docs or examples that would be great. I will take this concern to our admits&lt;BR /&gt;&lt;BR /&gt;At least one of our servers is on a different Timezone (-1 hour). Would this also contribute to the same type of issues?</description>
      <pubDate>Thu, 13 Oct 2016 11:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304338#M64788</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2016-10-13T11:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function - odd results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304343#M64789</link>
      <description>&lt;P&gt;Timezones should not be a problem. Computers keep their internal clocks in UTC, and use the timezone for display and input purposes.&lt;/P&gt;
&lt;P&gt;This of course means that timestamps taken "visually" from remote hosts need to be corrected for timezone offset.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 12:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-odd-results/m-p/304343#M64789</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-13T12:04:30Z</dc:date>
    </item>
  </channel>
</rss>

