Here you can find the source of getNow()
public static String getNow()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNow() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd H:mm:ss"); Date nowc = new Date(); String pid = formatter.format(nowc); return pid; }// w ww . ja v a 2s .c o m }