Here you can find the source of getTimeOnlyWithNumber()
public static String getTimeOnlyWithNumber()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimeOnlyWithNumber() { SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); return formatter.format(new Date()); }// w ww . j a v a 2 s. co m }