Here you can find the source of getSecond(Date date)
public static String getSecond(Date date)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static String getSecond(Date date) { return FormatDate(date, "ss"); }// w ww . j a v a 2 s .c o m public static String FormatDate(Date date, String sf) { if (date == null) return ""; SimpleDateFormat dateformat = new SimpleDateFormat(sf); return dateformat.format(date); } }