Here you can find the source of date2string(Date date)
public static String date2string(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String date2string(Date date) { SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.ENGLISH); //df.setTimeZone(TimeZone.getTimeZone("GMT+08:00")); String sendtime = df.format(date); //String sendtime = date.toString(); return sendtime; }/*from w w w.j a va 2 s . c om*/ }