Here you can find the source of asDate(String s)
static Date asDate(String s) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { static final ThreadLocal<SimpleDateFormat> FMT_TRADE_DATE = new ThreadLocal<SimpleDateFormat>() { protected SimpleDateFormat initialValue() { return new SimpleDateFormat("\"MM/dd/yyyy\""); //$NON-NLS-1$ }//from w w w . j ava 2 s. c om }; static Date asDate(String s) throws ParseException { if ("\"N/A\"".equals(s)) //$NON-NLS-1$ return null; return FMT_TRADE_DATE.get().parse(s); } }