Here you can find the source of currentTimeString()
public static String currentTimeString()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final SimpleDateFormat DATE_FORMAT_PART = new SimpleDateFormat("HH:mm"); public static String currentTimeString() { return DATE_FORMAT_PART.format(Calendar.getInstance().getTime()); }/*w w w. j ava 2s .c o m*/ }