Here you can find the source of getNowHour()
public static String getNowHour()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNowHour() { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); return sdf.format(new Date()); }/*from www. j a v a2s.c o m*/ }