Hi All
Somehow I need to transfer a String from the format "Aug 29 2000" to
"2000/8/29". I use the following code segment to do this transform.
dateStr = "Aug 29 2000";
ParsePosition pos = new ParsePosition(0);
SimpleDateFormat formatter = new SimpleDateFormat("MMM dd yyyy");
Date dt = formatter.parse(dateStr, pos);
formatter = new SimpleDateFormat("yyyy/M/d");
dateStr = formatter.format(dt);
However, the last statement [formatter.format(dt);] incurs
java.lang.NullPointerException.
So how could I avoid this excption? Should I use anothet approach to
transform
this String?
Thanks in advance
Lynch Wu
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets