Here you can find the source of getTimeString()
public static String getTimeString()
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final DateFormat timeFormat = new SimpleDateFormat("HHmmss.SSS"); /**/* w ww. j a v a2 s.c o m*/ * Get the current time in the default format. * * @return time in formatted string */ public static String getTimeString() { Date date = new Date(); return timeFormat.format(date); } }