سؤال

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

هل كانت مفيدة؟

المحلول

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

enter image description here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top