Here you can find the source of stringDate(Date now)
public static String stringDate(Date now)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String stringDate(Date now) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return simpleDateFormat.format(now); }//from ww w.j a va 2 s . c o m }