Here you can find the source of getCurrentTimeStamp()
public static String getCurrentTimeStamp()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*from www. ja va 2 s .c om*/ * Get the current date and time. * * @return returns the current date and time in the format: "dd-MM-yyyy_HH_mm_ss" */ public static String getCurrentTimeStamp() { SimpleDateFormat sdfDate = new SimpleDateFormat("dd-MM-yyyy_HH_mm_ss"); Date now = new Date(); return sdfDate.format(now); } }