Here you can find the source of convertStringToDate(String dateStr, String format)
Parameter | Description |
---|---|
dateStr | a parameter |
format | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static final Date convertStringToDate(String dateStr, String format) throws Exception
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//ww w. j av a 2s. c o m * * @param dateStr * @param format * @return * @throws Exception */ public static final Date convertStringToDate(String dateStr, String format) throws Exception { SimpleDateFormat sd = new SimpleDateFormat(format); Date pasrseDate = sd.parse(dateStr); return pasrseDate; } }