Here you can find the source of getCurrentTimeString()
public static String getCurrentTimeString()
//package com.java2s; import java.util.Calendar; public class Main { public static String getCurrentTimeString() { Calendar calendar = Calendar.getInstance(); return calendar.get(Calendar.HOUR_OF_DAY) + ":" + calendar.get(Calendar.MINUTE); }/*from w w w .j a va 2 s. c o m*/ }