Here you can find the source of formatTime(long dtNanos)
private static String formatTime(long dtNanos)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * /*w w w. j a va 2s. c om*/ * Contributors: * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ public class Main { private static String formatTime(long dtNanos) { String x = "" + dtNanos; while (x.length() < 7) { x = "0" + x; } return x.substring(0, x.length() - 6) + "." + x.substring(x.length() - 6); } }