<?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: How to round the time in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832824#M35728</link>
    <description>&lt;P&gt;SAS Datetime values are integers until the milliseconds part. So given that your values are actual numeric datetime values, you can use the Floor or Round Function depending on what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can find an appropriate SAS format if you do not want to change the actual values.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 06:43:08 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-09-12T06:43:08Z</dc:date>
    <item>
      <title>How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832814#M35725</link>
      <description>&lt;P&gt;What function can I use to change:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:34:826&amp;nbsp; --&amp;gt; 2014-07-09 11:42:34&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 04:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832814#M35725</guid>
      <dc:creator>P_Y</dc:creator>
      <dc:date>2022-09-12T04:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832815#M35726</link>
      <description>&lt;P&gt;Is that value stored in a numeric or character SAS variable? If it is numeric, what format is applied to it?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 04:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832815#M35726</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-09-12T04:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832823#M35727</link>
      <description>Is DATETIME22.3 format.&lt;BR /&gt;I tried to compute columns by using Timepart(2014-07-09 11:42:34:826) to get the time and in format TIME8, but it round up to 11:42:35. I just want to round down to 11:42:34:000.</description>
      <pubDate>Mon, 12 Sep 2022 06:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832823#M35727</guid>
      <dc:creator>P_Y</dc:creator>
      <dc:date>2022-09-12T06:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832824#M35728</link>
      <description>&lt;P&gt;SAS Datetime values are integers until the milliseconds part. So given that your values are actual numeric datetime values, you can use the Floor or Round Function depending on what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can find an appropriate SAS format if you do not want to change the actual values.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 06:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832824#M35728</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-12T06:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832861#M35729</link>
      <description>As Perter.C said, add one more function in it .&lt;BR /&gt;&lt;BR /&gt;Timepart( int( 2014-07-09 11:42:34:826 ) )</description>
      <pubDate>Mon, 12 Sep 2022 11:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832861#M35729</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-09-12T11:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the time</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832862#M35730</link>
      <description>&lt;P&gt;SAS datetime values are stored as the count of seconds since 1/1/1960. They are stored in a numerical values, can include fractional seconds and you can use any operator that's suitable for numerical values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case: If you would want to &lt;STRONG&gt;round&lt;/STRONG&gt; to seconds shouldn't the formatted value be&amp;nbsp;&lt;SPAN&gt;2014-07-09 11:42:3&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Given your dealing with a numerical variable and depending what you want use either of the following functions:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- round()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- int()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- floor()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- ceil()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;These functions area all documented under:&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of them will give you exactly what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last but not least: If it's just about printing the internal value without fractional seconds then use&amp;nbsp;&lt;SPAN&gt;DATETIME22. ...but be aware that this will use arithmetic&amp;nbsp;rounding so it will be 35 seconds.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 11:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-round-the-time/m-p/832862#M35730</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-09-12T11:13:18Z</dc:date>
    </item>
  </channel>
</rss>

