Here you can find the source of getTimeStamp()
public static String getTimeStamp()
//package com.java2s; //License from project: Open Source License import java.util.*; import java.text.*; public class Main { /**/*from www . j a v a2 s . com*/ * Get the current date and time (useful for logs, is thread safe). * @return a string containing the current date and time */ public static String getTimeStamp() { return new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy") .format(new Date(System.currentTimeMillis())); } }