Here you can find the source of getTimeStamp()
public static String getTimeStamp()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimeStamp() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String timeStamp = sdf.format(new Date(System.currentTimeMillis())); return timeStamp; }//from ww w.ja v a 2 s.c o m }