Here you can find the source of nowIdentity()
public static String nowIdentity()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* w w w .ja va2s. c om*/ * Returns the current identity like '20090831182858668' * * @return */ public static String nowIdentity() { return getFormat(now(), "yyyyMMddHHmmssSSS"); } public static String getFormat(java.util.Date date, String parseFormat) { if (null == date) { return null; } if (null == parseFormat || "".equalsIgnoreCase(parseFormat)) { return date.toString(); } return new SimpleDateFormat(parseFormat).format(date); } /** * Returns the current datetime. * * @return the current datetime. */ public static Date now() { return new Date(System.currentTimeMillis()); } }