Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getHoraAtual() { DateFormat df = new SimpleDateFormat("HH:mm"); Calendar cal = Calendar.getInstance(); return df.format(cal.getTime()); } }