Here you can find the source of dateParseFromMyJsFormat(String jsDate)
public static Date dateParseFromMyJsFormat(String jsDate) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat MY_JS_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); /**/* w ww .j a v a 2s .c om*/ * Parse date from my string format to Data * source string example - '2014-02-13_00.00.00' */ public static Date dateParseFromMyJsFormat(String jsDate) throws ParseException { /* if string '2014-02-13_00.00' then change it to '2014-02-13_00.00.00'*/ if (jsDate.split("_")[1].length() == 5) { jsDate += ".00"; } return MY_JS_DATE_FORMAT.parse(jsDate); } }