Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDateSuffix() { SimpleDateFormat formatter = new SimpleDateFormat("-yyyy-MM-dd-HH-mm-ss"); Date curDate = new Date(System.currentTimeMillis()); return formatter.format(curDate); } }