Here you can find the source of toSpacelessDateString(long millisSinceEpoch)
public static String toSpacelessDateString(long millisSinceEpoch)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String toSpacelessDateString(long millisSinceEpoch) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HHmmss", Locale.US);//from w w w. j a va 2 s . c o m Date t = new Date(millisSinceEpoch); return sdf.format(t); } }