Here you can find the source of GetCurrFormattedDateTime(String strFormatTo)
public static String GetCurrFormattedDateTime(String strFormatTo)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; public class Main { /**/* w w w .ja v a2s . c o m*/ * * @return String */ public static String GetCurrFormattedDateTime(String strFormatTo) { java.sql.Timestamp date = new java.sql.Timestamp( System.currentTimeMillis()); SimpleDateFormat formatter = new SimpleDateFormat(strFormatTo); return formatter.format(date); } }