Here you can find the source of FormatAsUtc(Date date)
public static String FormatAsUtc(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String FormatAsUtc(Date date) { SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); f.setTimeZone(TimeZone.getTimeZone("UTC")); return f.format(date); }//ww w . jav a 2s .c o m }