code: private static String formatTime(long ms)
      {
          StringTokenizer st = new StringTokenizer(new Date(ms).toString());
          ArrayList<String>	arrayList = new ArrayList<>();
          while (st.hasMoreTokens())
              arrayList.add(st.nextToken());
  
          String  time  = arrayList.get(3);
          double d = (double)ms/1000;
          long   l = ms/1000;
          d = (d - l) * 1000;
          ms = (long) d;
  
          return time + "." + ms;
      }
docs: ===============================================================