Here you can find the source of DateFromStringFormat(final String date, final String format)
public static Date DateFromStringFormat(final String date, final String format) throws NullPointerException, ParseException
//package com.java2s; /*// w w w. jav a2s. c o m * Copyright (c) 2015. Sandata Technologies, LLC * 26 Harbor Park Drive, Port Washington, NY 11050, 800-544-7263 * All rights reserved. * * This software is the confidential and proprietary information of Sandata Technologies, LLC * ("Confidential Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered into with * Sandata. */ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date DateFromStringFormat(final String date, final String format) throws NullPointerException, ParseException { if (date == null) { throw new NullPointerException("DateUtil: DateFromStringFormat: date == null"); } if (format == null) { throw new NullPointerException("DateUtil: DateFromStringFormat: format == null"); } DateFormat dateFormat = new SimpleDateFormat(format, Locale.ENGLISH); return dateFormat.parse(date); } }