Here you can find the source of currentTimeMillis()
public static long currentTimeMillis()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.*; public class Main { private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static long currentTimeMillis() { return getToday().getTime(); }//from ww w. j a v a2 s . c om public static String getTime() { return sdfTime.format(new Date()); } public static Date getToday() { return new Date(); } }