Here you can find the source of getDisplayTimeStamp(Date date)
public static String getDisplayTimeStamp(Date date)
//package com.java2s; /*/* ww w.j a v a2 s . c o m*/ * JLib - Publicitas Java library v1.2.0. * * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA. * Licensed under LGPL (LGPL-LICENSE.txt) license. */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { private String format = "yyyy.MM.dd HH:mm:ss"; public static String getDisplayTimeStamp() { Date date = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String cs = formatter.format(date); return cs; } public static String getDisplayTimeStamp(Date date) { if (date != null) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String cs = formatter.format(date); return cs; } return ""; } }