title: How to convert seconds to format HH:mm:ss in Kusto
body: <p>I would like to know the best way to transform a duration in seconds in something more user friendly like HH:MM:SS.</p>
  
  <p>I have found a solution, but I don't think it's the best one:</p>
  
  <p>I use a random datetime <code>make_datetime(2017,1,1)</code>, I add the amount of seconds with <code>datetime_add</code> and then I format the result to get "HH:mm:ss"</p>
  
  <pre><code>AzureDiagnostics 
  
  | project  
  
  Duration = format_datetime(
                     datetime_add('second',
                                  toint(Output_copyDuration_d),
                                  make_datetime(2017,1,1)
                                  ),
                     "HH:mm:ss")
  </code></pre>
  
  <p>where Output_copyDuration_d is the duration stored in seconds</p>
  
  <p>My results are correct </p>
  
  <p>if Output_copyDuration_d = 234 then I get Duration =  00:03:54</p>