Here you can find the source of iso8601(String date)
public static Date iso8601(String date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static Date iso8601(String date) { try {//w w w . ja v a2s . com return newDateFormat().parse(date); } catch (ParseException e) { throw new RuntimeException(e); } } public static String iso8601(Date date) { return newDateFormat().format(date); } private static DateFormat newDateFormat() { DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat; } }