mediii
mediii

Reputation: 97

Why won't my SimpleDateFormat convert correctly?

I have my Date as String: 2014-06-23 22:00

To get the Date as java.util.date I parse it by using SimpleDateFormat

Date listDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD HH:mm",Locale.GERMANY);
listDate = sdf.parse(gameList.get(position).getTime());

but my output

    System.out.println(listDate)

is 2014-04-118 19:37

What's going on here??

Upvotes: 2

Views: 90

Answers (1)

Niraj Patel
Niraj Patel

Reputation: 2208

DD should be dd (in small) below are the available formats in Java7

enter image description here

Upvotes: 3

Related Questions