File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes java.text.ParseException: Unparseable date: Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java.text.ParseException: Unparseable date: """ Watch "java.text.ParseException: Unparseable date: """ New topic
Author

java.text.ParseException: Unparseable date: ""

jatinkumar patel
Greenhorn

Joined: Apr 19, 2009
Posts: 23
Need help with parsing date. I am new to parsing of date.
Thanks for help



Eoor i am getting



Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
In
Private static SimpleDateFormat df = new SimpleDateFormat("MM-dd-yyyy",Locale.US);

I think parsing of MM-dd-yyyy is not posible ("-"). Remove "-" then try it.
To manipulate using the date, use ("MMddyyyy",Locale.US);

If you are not manipulating the data then, don't have to parse.


Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



In
Private static SimpleDateFormat df = new SimpleDateFormat("MM-dd-yyyy",Locale.US);

I think parsing of MM-dd-yyyy is not posible ("-"). Remove "-" then try it.
To manipulate using the date, use ("MMddyyyy",Locale.US);

If you are not manipulating the data then, don't have to parse.



Its possible to parse date of any format as long as the date matches the format that you are trying to parse.

Here the problem is date is empty and you are trying to parse it.


First understand the use of parse method , it takes String as argument in the format as passed SimpleDateFormat 's constructor and returns corresponding date object.



Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Thank you I didn't know it
jatinkumar patel
Greenhorn

Joined: Apr 19, 2009
Posts: 23

Thanks Balu Sadhasivam and Mahi Lohi for quick reply.


I made the mistake of parsing NULL value, Henceforth i was getting the previous mentioned exception.
So did the following



Thanks for meaningful and quick help.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java.text.ParseException: Unparseable date: ""
 
Similar Threads
struts form being cleared in IE 6
HTTP Status 404 - Servlet action is not available
Validation method in lookup form
String to Date
The constructor ActionError(String) is deprecated"!!