Here you can find the source of formatDate(Date date)
static public String formatDate(Date date)
//package com.java2s; // Use of this software is governed by the GPLv3 license import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { static public String formatDate(Date date) { SimpleDateFormat sd = new SimpleDateFormat("EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss' 'zzz", Locale.US); sd.setTimeZone(TimeZone.getTimeZone("GMT")); return sd.format(new Date()); }/*from www .j av a 2 s .c om*/ }