Android examples for java.util:Hour
get Now Time in HH format
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNowTime() { SimpleDateFormat formatter = new SimpleDateFormat("HH"); Date curDate = new Date(System.currentTimeMillis()); return formatter.format(curDate); }/*ww w . j av a 2 s .c o m*/ }