Here you can find the source of getCurrentUTCDate()
public static String getCurrentUTCDate()
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { private static final String STANDARD_DATE_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss'Z'"; public static String getCurrentUTCDate() { Calendar cal = Calendar.getInstance(); DateFormat df = new SimpleDateFormat(STANDARD_DATE_FORMAT_STRING); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(cal.getTime()); }// w w w . jav a2s .c om }