Here you can find the source of parseIsoDate(final String isoDateString)
Parameter | Description |
---|---|
isoDateString | a parameter |
public static Date parseIsoDate(final String isoDateString)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /**//w w w .ja v a 2 s. co m * Format yyyy-mm-dd * * @param isoDateString * @return Parsed date or null if a parse error occurs. */ public static Date parseIsoDate(final String isoDateString) { return parseIsoDate(isoDateString, TimeZone.getDefault()); } /** * Format yyyy-mm-dd * * @param isoDateString * @return Parsed date or null if a parse error occurs. */ public static Date parseIsoDate(final String isoDateString, final TimeZone timeZone) { final DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); df.setTimeZone(timeZone); Date date; try { date = df.parse(isoDateString); } catch (final ParseException ex) { return null; } return date; } }