Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String sqlTimeFormate = "HH:mm:ss"; public static String getTodaysTime() { SimpleDateFormat formater = new SimpleDateFormat(sqlTimeFormate); return formater.format(new Date()); } public static String getTodaysTime(String format) { SimpleDateFormat formater = new SimpleDateFormat(format); return formater.format(new Date()); } }