Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date dateFormat(String arcTime, String format) { SimpleDateFormat formatSrc = new SimpleDateFormat(format); Date date = null; try { date = formatSrc.parse(arcTime); } catch (ParseException e) { e.printStackTrace(); } return date; } }