Parsing Java Date
I have a date that is formatted like this 2010-11-22T00:00:00
I am attempting to parse it into java date.
For the past hour I've tried different SimpleDateFormats using the api yet I keep throwing java.text.ParseException: Unparseable date: "2010-11-22T00:00:00".
Does anyone happen to know the solution to this, or must I concatenate the date?
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-dd-MMM", Locale.US);
Date crtDate = sdf.parse(dt);
You are creating a formatter that will parse yyyy-dd-MMM but you are attempting to parse yyyy-dd-MM'T'hh:mm:ss with it. At least I'm guessing that's what you're trying to do.
SimpleDateFormat (Java Platform SE 6)
so I should perform
Than I should be able to format crtDate anyway I want?
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-dd-MM'T'hh:mm:ss", Locale.US);
Date crtDate = sdf.parse("2010-11-22T00:00:00");
What happened when you tried that?
Originally Posted by Sno