简体   繁体   中英

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

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM