Here you can find the source of formatInfo(String info)
public static String formatInfo(String info)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static String formatInfo(String info) { return getCurDateTime() + " : " + info + "\n"; }/*ww w .j a v a 2 s . co m*/ public static String getCurDateTime() { return getCurDateTime(DEFAULT_PATTERN); } public static String getCurDateTime(String formatStr) { SimpleDateFormat sdf = new SimpleDateFormat(formatStr); String now = sdf.format(new Date()); return now; } }