Here you can find the source of ISO8601ToTimestamp(String aDate)
public static long ISO8601ToTimestamp(String aDate)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static long ISO8601ToTimestamp(String aDate) { long result = 0; SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ"); try {// www.j a va2 s. c o m result = new Timestamp(format.parse(aDate).getTime()).getTime(); } catch (ParseException e) { e.printStackTrace(); } return result; } public static long parse(String aFormat, String date) { SimpleDateFormat format = new SimpleDateFormat(aFormat); try { return format.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0; } } }