Here you can find the source of getCurrentStrTimeMills()
public static String getCurrentStrTimeMills()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentStrTimeMills() { return getCurrentStrTime("yyyy-MM-dd HH:mm:ss:SSS"); }/*from w w w. ja v a 2 s . c o m*/ public static String getCurrentStrTime() { return getCurrentStrTime("yyyy-MM-dd HH:mm:ss"); } public static String getCurrentStrTime(String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); Date date = new Date(); String currentTime = sdf.format(date); return currentTime; } }