Here you can find the source of getSecond()
public static String getSecond()
//package com.java2s; //License from project: LGPL import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from w ww . ja v a 2 s . c o m * Get the current second * @return The current second */ public static String getSecond() { Date date = new Date(); SimpleDateFormat format = new SimpleDateFormat("ss"); String output = format.format(date); return output; } }