inserer date in oracle suos forme long
Bonjour,
J'aimerais insérer la date courante sous format dd/MM/yyyy HH:mm:ss dans oracle 9.2 mais je n'arrive pas. Pourtant je formate la date comme il faut avec un simpledateformat
Code:
1 2
| SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String strDate = sdf.format(date); |
Mais le pb c'est que j'insere la date uniquement sous forme dd/MM/yyyy si j'utilise un parse.
Voici le code entier
Code:
1 2 3 4 5 6 7 8
| Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
try{
myObject.setDateModification(sdf.parse(sdf.format(date)));
}catch(java.text.ParseException pex){
pex.printStackTrace();
} |
y a t il une solution? Merci