title: conversion from NSTimeInterval to hour,minutes,seconds,milliseconds in swift
body: <p>My code is here:</p>
  
  <pre><code>func stringFromTimeInterval(interval:NSTimeInterval) -&gt; NSString {
  
      var ti = NSInteger(interval)
      var ms = ti * 1000
      var seconds = ti % 60
      var minutes = (ti / 60) % 60
      var hours = (ti / 3600)
  
        return NSString(format: "%0.2d:%0.2d:%0.2d",hours,minutes,seconds,ms)
  }
  </code></pre>
  
  <p>in output the milliseconds give wrong result.Please give an idea how to find milliseconds correctly.</p>