Android examples for java.util:Date Format
format Date to string in yyyy-MM-dd'T'HH:mm:ss.SSS format
import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Date; public class Main{ private static final SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS"); /**//w w w .jav a 2 s. c o m * * @param date * @return */ public static String formatDate(Date date) { return sdf.format(date); } }