//date format
import org.apache.commons.lang3.time.DateFormatUtils;
String timeStr = DateFormatUtils.format(dateDate,"yyyy-MM-dd HH:mm:ss");
Date dateTime = DateUtils.parseDate(dateTimeStr,"yyyy-MM-dd HH:mm:ss");
//capitalize the first letter of word
String output = input.substring(0, 1).toUpperCase() + input.substring(1);
//measure the time cost
long start = System.nanoTime();
//...
long end = System.nanoTime();
long used = end-start;
System.out.println("used:"+TimeUnit.NANOSECONDS.toMillis(used)+" ms");