Here you can find the source of formatDateUTC(Date date)
public static String formatDateUTC(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String formatDateUTC(Date date) { return (date != null) ? getDateFormat().format(date) : null; }/* www .ja v a 2 s. c o m*/ private static DateFormat getDateFormat() { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat; } }