Here you can find the source of parse(String datestr)
private static Date parse(String datestr)
//package com.java2s; /*//from w ww. j a va2s . com * ************************************************************************************* * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * * ************************************************************************************* */ import java.text.SimpleDateFormat; import java.util.*; public class Main { private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; private static Date parse(String datestr) { Date date; try { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); date = sdf.parse(datestr); } catch (Exception ex) { throw new RuntimeException("Error parsing date '" + datestr + "' as format '" + DATE_FORMAT + "' : " + ex.getMessage(), ex); } return date; } }