<?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: time calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-calculation/m-p/1938438#M387888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;  it seems mathematical calculations needed for ur query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) 20 hrs is converted internally to seconds that is 20 * 60 * 60 = 72000 sec.&lt;/P&gt;&lt;P&gt;    2 hrs is converted internally to seconds that is 2 * 60 * 60 =7200 sec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) As per ur program u have mentioned as 2 hrs - 20 hrs.&lt;/P&gt;&lt;P&gt;   I put it in a correct form, 7200 - 72000 which gives u -64800 sec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Feb 2007 14:43:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-17T14:43:48Z</dc:date>
    <item>
      <title>time calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-calculation/m-p/1938437#M387887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could someone explain me the following from the code below:-&lt;/P&gt;&lt;P&gt;q1]]   How do we get "72000 and 7200 "  ?&lt;/P&gt;&lt;P&gt;q2]]    How do we get "-64800"?&lt;/P&gt;&lt;P&gt;q3]]    what is the possible answer ? Is not it  that from  say 2 ' o clock  morning to  8 ' clock evening i,e., we get 18 hours----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;then why is this logic required??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  code:-&lt;/P&gt;&lt;P&gt;Example of a time calculation:&lt;/P&gt;&lt;P&gt;DATA: DIFF TYPE I,&lt;/P&gt;&lt;P&gt;SECONDS TYPE I,&lt;/P&gt;&lt;P&gt;HOURS TYPE I.&lt;/P&gt;&lt;P&gt;DATA: T1 TYPE T VALUE '200000',&lt;/P&gt;&lt;P&gt;T2 TYPE T VALUE '020000'.&lt;/P&gt;&lt;P&gt;DIFF = T2 - T1.&lt;/P&gt;&lt;P&gt;SECONDS = DIFF MOD 86400.&lt;/P&gt;&lt;P&gt;HOURS = SECONDS / 3600.&lt;/P&gt;&lt;P&gt;The number of hours between 02:00:00 and 20:00:00 is calculated.&lt;/P&gt;&lt;P&gt;1. First, the difference between the time fields is calculated. This is -64800, since T1&lt;/P&gt;&lt;P&gt;and T2 are converted internally into 72000 and 7200 respectively.&lt;/P&gt;&lt;P&gt;2. Second, with the operation MOD, this negative difference is converted to the total&lt;/P&gt;&lt;P&gt;number of seconds. A positive difference would be unaffected by this calculation.&lt;/P&gt;&lt;P&gt;3. Third, the number of hours is calculated by dividing the number of seconds by 3600.&lt;/P&gt;&lt;P&gt;The last three lines can be replaced by the following line&lt;/P&gt;&lt;P&gt;HOURS = ( ( T2 - T1 ) MOD 86400 ) / 3600&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2007 13:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-calculation/m-p/1938437#M387887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-17T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: time calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-calculation/m-p/1938438#M387888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;  it seems mathematical calculations needed for ur query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) 20 hrs is converted internally to seconds that is 20 * 60 * 60 = 72000 sec.&lt;/P&gt;&lt;P&gt;    2 hrs is converted internally to seconds that is 2 * 60 * 60 =7200 sec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) As per ur program u have mentioned as 2 hrs - 20 hrs.&lt;/P&gt;&lt;P&gt;   I put it in a correct form, 7200 - 72000 which gives u -64800 sec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2007 14:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-calculation/m-p/1938438#M387888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-17T14:43:48Z</dc:date>
    </item>
  </channel>
</rss>

