Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { private final static String formatB = "yyyyMMdd HH:mm:ss.SSS"; public static Date parseDate_B(String dateStr) throws ParseException { return new SimpleDateFormat(formatB, Locale.getDefault()).parse(dateStr); } }