Here you can find the source of getISO8601DateString(Date d)
public static String getISO8601DateString(Date d)
//package com.java2s; /* J_LZ_COPYRIGHT_BEGIN ******************************************************* * Copyright 2001-2004, 2008, 2011 Laszlo Systems, Inc. All Rights Reserved. * * Use is subject to license terms. * * J_LZ_COPYRIGHT_END *********************************************************/ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { public static String getISO8601DateString(Date d) { DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH); dfm.setTimeZone(TimeZone.getTimeZone("GMT")); return dfm.format(d); }/*w ww . j a v a 2 s.c o m*/ }