Here you can find the source of getNowDate(String format)
public static String getNowDate(String format)
//package com.java2s; import java.text.*; import java.util.Calendar; import java.util.Locale; public class Main { public static final String DEFAULT_NOW_STRING_FORMAT = "yyyyMMddHHmmssSSS"; public static String getNowDate() { return getNowDate(DEFAULT_NOW_STRING_FORMAT); }//from w w w . ja v a 2 s . c o m public static String getNowDate(String format) { if (format == null) { return null; } SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.JAPAN); java.util.Date date = Calendar.getInstance().getTime(); if (date == null) { return null; } return sdf.format(date); } }