Here you can find the source of timestampSec(Date date)
public static String timestampSec(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String timestampSec(Date date) { final SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyyMMdd-HHmmss"); return dateFormat.format(date); }//from w w w .ja va 2 s . co m }