Here you can find the source of getStringWithTime(String str)
public static String getStringWithTime(String str)
//package com.java2s; //License from project: Apache License import java.util.*; import java.text.*; public class Main { public static String getStringWithTime(String str) { DateFormat dateFormat = DateFormat.getTimeInstance(); return "(" + dateFormat.format(new Date()) + ") " + str; }//w ww .j ava2 s .c om }