Here you can find the source of getCurrentDate()
public static java.sql.Date getCurrentDate()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static java.sql.Date getCurrentDate() { return new java.sql.Date(new Date().getTime()); }// w w w .j a v a 2 s . co m public static String getTime() { Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateString = formatter.format(currentTime); String min; min = dateString.substring(14, 16); return min; } }