<?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: Formation duration as HH:mm in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/283324#M2420</link>
    <description>&lt;P&gt;Hi, can you please tell me how did u achieve this with the runtime field u have in the dql ? I have similar query, but not able to change the format in my dashboard.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Aug 2025 20:28:51 GMT</pubDate>
    <dc:creator>susmita_k</dc:creator>
    <dc:date>2025-08-07T20:28:51Z</dc:date>
    <item>
      <title>Formation duration as HH:mm</title>
      <link>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269068#M1657</link>
      <description>&lt;P&gt;I have a dashboard that lists task durations based on log timestamps. My DQL looks something like.&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;fetch logs&lt;BR /&gt;| parse content, "LD JSON:audit"&lt;BR /&gt;| fields timestamp, audit&lt;BR /&gt;| fieldsAdd uuid = audit[uuid], Task = audit[status_name], status = audit[status]&lt;BR /&gt;| fieldsRemove audit&lt;BR /&gt;| summarize {start_time = min (timestamp), &lt;BR /&gt;end_time = max(timestamp)}&lt;BR /&gt;, by: {uuid, Task}&lt;BR /&gt;| fieldsAdd runtime = end_time - start_time&lt;BR /&gt;| fields Task, runtime, start_time, end_time&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The field runtime has the datatype “duration”, is listed in nanoseconds and is formatted as &amp;nbsp;hours. So in the dashboard the durations are shows as &amp;nbsp;“3,15 h” and “11,99 h”. However I want to format it as HH:mm. So “3,15 h” is “03:09” and “2,99 h” is “11:59”. How can I do this?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 10:31:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269068#M1657</guid>
      <dc:creator>Jarren</dc:creator>
      <dc:date>2025-02-10T10:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Formation duration as HH:mm</title>
      <link>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269128#M1666</link>
      <description>&lt;P&gt;Unfortunately there is not with single function call, but with some arithmetic and string operations:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(d=duration(3.15, "h")),
record(d=duration(2.99, "h")),
record(d=duration(1.8, "m")),
record(d=duration(120, "m")),
record(d=duration(12.25, "h")),
record(d=duration(5, "d")),
record(d=duration(30, "s")),
record(d=duration(29, "s")),
record(d=duration(10, "ms"))
| fieldsAdd h=toString(toLong(d/1h)), m=toString(toLong(round(d/1m)) % 60)
| fields d, hm = concat( if(stringLength(h)&amp;lt;2, concat("0",h), else:h), ":", if(stringLength(m)&amp;lt;2, concat("0",m), else:m))&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1738610976726.png" style="width: 851px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26166iAB91BB66FEEED2DC/image-dimensions/851x734?v=v2" width="851" height="734" role="button" title="krzysztof_hoja_0-1738610976726.png" alt="krzysztof_hoja_0-1738610976726.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 19:29:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269128#M1666</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-02-03T19:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Formation duration as HH:mm</title>
      <link>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269170#M1669</link>
      <description>&lt;P&gt;Thank you, it works!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 06:45:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/269170#M1669</guid>
      <dc:creator>Jarren</dc:creator>
      <dc:date>2025-02-04T06:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formation duration as HH:mm</title>
      <link>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/283324#M2420</link>
      <description>&lt;P&gt;Hi, can you please tell me how did u achieve this with the runtime field u have in the dql ? I have similar query, but not able to change the format in my dashboard.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 20:28:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Formation-duration-as-HH-mm/m-p/283324#M2420</guid>
      <dc:creator>susmita_k</dc:creator>
      <dc:date>2025-08-07T20:28:51Z</dc:date>
    </item>
  </channel>
</rss>

