Question

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??

Était-ce utile?

La solution

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

enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top