Here you can find the source of getCurTime(String dateformat)
public static String getCurTime(String dateformat)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static String getCurTime(String dateformat) { Calendar calendar = new GregorianCalendar(); Date date = calendar.getTime(); SimpleDateFormat format = new SimpleDateFormat(dateformat); return format.format(date); }/*from www. jav a 2 s. c o m*/ }