Erreur écriture Properties
Bonjour,
Je me sert de ce code pour créer un fichier Properties.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Properties Metoc = new Properties();
DateFormat Formdate = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
Date dt = new Date();
try {
//set the properties value
Metoc.setProperty("Heure", (Formdate.format(dt)).toString());
//save properties to project root folder
Metoc.store(new FileOutputStream("config.properties"), null);
System.out.println(Formdate.format(dt));
} catch (IOException ex) {
ex.printStackTrace();
} |
Voici ce que j'obtiens pour
Code:
Metoc.setProperty("Heure", (Formdate.format(dt)).toString())
Citation:
Heure=04/12/13 09\:49
Alors que
Code:
System.out.println(Formdate.format(dt));
me donne il n'y a pas ce "\" devant les minute.:calim2: