Here you can find the source of formatSimpleDate(Date date)
public static String formatSimpleDate(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static final SimpleDateFormat SIMPLE_DAY_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static String formatSimpleDate(Date date) { if (date == null) { return ""; }//from w w w . java 2 s.c o m return SIMPLE_DAY_FORMAT.format(date); } /** * Format date with UTC time zone. * * @param date * @param pattern * @return */ public static String format(Date date, String pattern) { SimpleDateFormat sdf = new SimpleDateFormat(pattern); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); } }