Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { private static final String DATE_FORMAT_EEEEMMMMDYYYYHMMA = "EEEE, MMMM d, yyyy h:mm a"; public static final String toString_EEEEMMMMdyyyyhmma(Date date) { return format(date, DATE_FORMAT_EEEEMMMMDYYYYHMMA); } public static final String format(Date date, String format) { return formatter(format).format(date); } public static final DateFormat formatter(String format) { return new SimpleDateFormat(format); } private static final DateFormat formatter(String format, TimeZone tz) { DateFormat out = formatter(format); out.setTimeZone(tz); return out; } }