Here you can find the source of getTimeStampByFormat(String style)
public static String getTimeStampByFormat(String style)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimeStampByFormat(String style) { DateFormat format = new SimpleDateFormat(style); return format.format(new Date()); }/* ww w . j a va 2 s. com*/ }