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