Here you can find the source of getCurrentDate()
public static final Date getCurrentDate()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String dateFormat = "yyyy-MM-dd HH:mm:ss"; public static final Date getCurrentDate() { Date currentDate = new Date(); SimpleDateFormat df = new SimpleDateFormat(dateFormat); df.format(currentDate);/* w w w. java 2s. c o m*/ currentDate.getTime(); return currentDate; } public static final Date getCurrentDate(String pattern) { Date currentDate = new Date(); SimpleDateFormat df = new SimpleDateFormat(pattern); df.format(currentDate); currentDate.getTime(); return currentDate; } }