Here you can find the source of getMinute()
public static String getMinute()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getMinute() { Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateString = formatter.format(currentTime); String min;/* w w w.j a v a2s . co m*/ min = dateString.substring(14, 16); return min; } }