Here you can find the source of toDate(String date)
public static Date toDate(String date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.TimeZone; import javax.xml.bind.DatatypeConverter; public class Main { private static final String TIMEZONE = "UTC"; public static Date toDate(String date) { Calendar cal = DatatypeConverter.parseDateTime(date); cal.setTimeZone(TimeZone.getTimeZone(TIMEZONE)); return cal.getTime(); }//from w ww. j av a2s .c om }