Erreur de changement de type
salut,
je veux changer un type String vers un type Date
j'essaye avec ce code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
String mois=11;
String jour=03;
String anne=2012;
String recup=anne+"-"+mois+"-"+jour;
DateFormat formatter ;
Date date = null ;
formatter = new SimpleDateFormat("yy-MMM-dd");
try {
date = (Date)formatter.parse(recup);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} |
mais après execution de code cette erreur est affichée
Code:
ERROR [STDERR] java.text.ParseException: Unparseable date: "2012-11-03"