Here you can find the source of parseTimeStamp(String timeStamp)
public static Calendar parseTimeStamp(String timeStamp)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static final DateFormat FORMAT_DATE_TIME = new SimpleDateFormat("dd/MM/yyyy HH:mm"); public static final DateFormat FORMAT_TIMESTAMP = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS"); public static Calendar parseTimeStamp(String timeStamp) { return parseDateTime(timeStamp, FORMAT_TIMESTAMP); }// ww w . j ava 2 s .c om public static Calendar parseDateTime(String dateTime) { return parseDateTime(dateTime, FORMAT_DATE_TIME); } public static Calendar parseDateTime(String dateTime, DateFormat format) { Calendar resultado = GregorianCalendar.getInstance(); try { resultado.setTime(format.parse(dateTime)); } catch (ParseException e) { throw new IllegalArgumentException(e); } return resultado; } }