DateFormat

P

Peter Plumber

I have problems parsing and reformatting a date string

DateFormat dfIn = new SimpleDateFormat("yyyy-MM-dd hh:mm:ssZZZ");
theDate = dfIn.parse("2006-05-17 10:57:00+02");

unfortunately this does not work
and I do not fully understand the javadoc

thx

Peter
 
P

plasticfloor

you're missing two digits at the end +0200

a good way to go about a problem like this for next time is -

Date now = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ssZZZ");
System.out.println( df.format( now ));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top