Java tutorial
//package com.java2s; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final DecimalFormat format = new DecimalFormat("#.0"); public static String getCurrentTime() { SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss.SSS"); return sdf.format(new Date()); } }