Pergunta

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

Foi útil?

Solução

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

enter image description here

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top