Here you can find the source of HourNow()
static String HourNow()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { static String HourNow() { int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); int min = Calendar.getInstance().get(Calendar.MINUTE); int sec = Calendar.getInstance().get(Calendar.SECOND); return "[" + hour + ":" + min + ":" + sec + "]"; }/*from w ww . j av a 2s.c o m*/ }