Here you can find the source of getMinute()
public static String getMinute()
//package com.java2s; import java.util.*; public class Main { public static String getMinute() { Calendar calendar = Calendar.getInstance(); String mi = "0" + calendar.get(Calendar.MINUTE); mi = mi.substring(mi.length() - 2, mi.length()); return mi; }/*from w w w . jav a2 s .c o m*/ }