Here you can find the source of getCurrentDateJSONString()
public static String getCurrentDateJSONString()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String getCurrentDateJSONString() { return toUTCFormattedString(new Date()); }//from w w w .java 2 s .c o m public static String toUTCFormattedString(Date date) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); df.setTimeZone(TimeZone.getTimeZone("UTC")); return df.format(date); } }