Results 1 to 4 of 4
Thread: Parsing Java Date
- 11-24-2010, 03:39 PM #1
Parsing Java Date
Hey Guys,
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?Java Code:SimpleDateFormat sdf = new SimpleDateFormat("yyyy-dd-MMM", Locale.US); Date crtDate = sdf.parse(dt); System.out.println(crtDate);:rolleyes: ~ Sno ~ :rolleyes:
'-~ B.S. Computer Science ~-'
- 11-24-2010, 03:57 PM #2
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)
- 11-24-2010, 04:03 PM #3
so I should perform
Than I should be able to format crtDate anyway I want?Java Code:SimpleDateFormat sdf = new SimpleDateFormat("yyyy-dd-MM'T'hh:mm:ss", Locale.US); Date crtDate = sdf.parse("2010-11-22T00:00:00");:rolleyes: ~ Sno ~ :rolleyes:
'-~ B.S. Computer Science ~-'
- 11-24-2010, 04:06 PM #4
Similar Threads
-
java.util.Date vs java.sql.Date
By Jack in forum New To JavaReplies: 5Last Post: 10-28-2010, 02:59 PM -
parsing date problem
By jackjosh_in in forum Advanced JavaReplies: 7Last Post: 05-21-2010, 02:06 PM -
parsing date
By jackjosh_in in forum New To JavaReplies: 2Last Post: 05-21-2010, 01:07 PM -
E:\IT 215 Java Programming\Inventory.java:211: reached end of file while parsing
By tlouvierre in forum New To JavaReplies: 1Last Post: 05-31-2009, 06:48 PM -
Parsing URL in Java
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:14 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks