Here you can find the source of parseDate(String date)
Parameter | Description |
---|---|
date | the string representation fo a date, formatted according to DateUtils.DATE_FORMAT |
public static Date parseDate(String date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final String DATE_FORMAT = "dd/MM/yyyy"; private static SimpleDateFormat dateFormat; /**// w w w.ja v a2s.c om * @param date the string representation fo a date, formatted according to DateUtils.DATE_FORMAT * @return the converted date object, or null in case of failure */ public static Date parseDate(String date) { checkDateFormat(); try { return dateFormat.parse(date); } catch (ParseException e) { return null; } } private static void checkDateFormat() { if (dateFormat == null) { dateFormat = new SimpleDateFormat(DATE_FORMAT); } } }