Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert String to timestamp

807569Jun 1 2006 — edited Jun 1 2006
Hi,

I have problem converting the following string to timestamp.

SimpleDateFormat sdf = new SimpleDateFormat(
"MM/dd/yyyy HH:mm");
sdf.setLenient(false);
String date = "200601110300";
long timeInMillis = sdf.parse(date).getTime();
Timestamp timestamp = new Timestamp(timeInMillis);
System.out.println(timestamp);

java.text.ParseException: Unparseable date: "200601110300"

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2006
Added on Jun 1 2006
2 comments
166 views