Java examples for java.util:Time Format
current Time String in HH:mm format
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static void main(String[] argv) { System.out.println(currentTimeString()); }// w ww . ja v a 2s . co m public static final SimpleDateFormat DATE_FORMAT_PART = new SimpleDateFormat( "HH:mm"); public static String currentTimeString() { return DATE_FORMAT_PART.format(Calendar.getInstance().getTime()); } }