| Author |
Convert String to Java Date
|
ryan bohnert
Greenhorn
Joined: Feb 27, 2008
Posts: 15
|
|
I am trying to convert a string to Java Date.
java.text.ParseException: Unparseable date: "2008-04-22T09:00:10.548-06:00"
Any suggestions?
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
You're parse string should be
2008-04-22T09:00:10.548GMT-06:00
2008-04-22T09:00:10.548Pacific Standard Time-06:00
or something like that.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32638
|
|
|
Go through the SimpleDateFormat documentation. When you get to the Z bit for time zone, the example shown has -0800, not -08:00. It is different if you write z from if you write Z.
|
 |
 |
|
|
subject: Convert String to Java Date
|
|
|