The code below gives me the current time. But it does not tell anything about milliseconds.
public static String getCurrentTimeStamp() { SimpleDateForm
Use this to get your current time in specified format :
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.print(dateFormat.format(System.currentTimeMillis())); }