Here you can find the source of toIsoString(Date date)
public static String toIsoString(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat ISO_8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SZ"); /**//from w w w. j a v a 2 s. co m * Returns the given Date as a String in ISO 8601 format. */ public static String toIsoString(Date date) { synchronized (ISO_8601) { return ISO_8601.format(date); } } }