Here you can find the source of getCurrentTimeAndDate()
public static final String getCurrentTimeAndDate()
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j av a2 s . co m*/ * Returns the current time and date in a formatted string. * @return The string containing time and date. */ public static final String getCurrentTimeAndDate() { return java.text.DateFormat.getDateTimeInstance().format(new java.util.Date()); } }