Here you can find the source of timeToString(Date date)
public static String timeToString(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String TIME_PARTTEN = System.getProperty("TIME_PARTTEN", "yyyy-MM-dd HH:mm:ss"); public static String timeToString(Date date) { SimpleDateFormat sdf = new SimpleDateFormat(TIME_PARTTEN); return sdf.format(date); }//from w ww . j av a2 s . c o m }