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