Here you can find the source of getDateFromString(String iso, String format)
Parameter | Description |
---|---|
iso | - |
format | - |
public static Date getDateFromString(String iso, String format)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from www . j av a 2 s . c om * @param iso - * @param format - * @return - */ public static Date getDateFromString(String iso, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); sdf.setLenient(false); try { return sdf.parse(iso); } catch (ParseException e) { e.printStackTrace(); } return null; } }