Here you can find the source of formatTimestamp(Date timestamp)
public static String formatTimestamp(Date timestamp)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; public class Main { private static final TimeZone UTC = TimeZone.getTimeZone("UTC"); private static final String DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; public static String formatTimestamp(Date timestamp) { DateFormat format = new SimpleDateFormat(DATE_TIME_FORMAT); format.setCalendar(new GregorianCalendar(UTC)); return format.format(timestamp); }/*from www . ja va 2 s . c o m*/ }