Here you can find the source of getDateFromDCItemTimestamp(String dateTimeStamp)
public static Date getDateFromDCItemTimestamp(String dateTimeStamp)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static Date getDateFromDCItemTimestamp(String dateTimeStamp) { Date dateTime = null;//from w w w . ja v a 2 s .c o m if (dateTimeStamp != null && dateTimeStamp.length() > 0) { SimpleDateFormat ISO8601Local = new SimpleDateFormat("yyyyMMddHHmmss"); TimeZone timeZone = TimeZone.getDefault(); ISO8601Local.setTimeZone(timeZone); try { dateTime = (Date) ISO8601Local.parse(dateTimeStamp.trim()); } catch (ParseException e) { System.err.println(dateTimeStamp); System.err.println("Error parsing date string should be yyyyMMddHHmmss format: " + e.getMessage()); } } return dateTime; } }