Here you can find the source of getNowTime(String formatStr)
public static String getNowTime(String formatStr)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNowTime() { return new SimpleDateFormat("HHmmss").format(new Date()); }/*from w w w.j a va2 s .co m*/ public static String getNowTime(String formatStr) { return new SimpleDateFormat(formatStr).format(new Date()); } }