joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007
-
9 mai 2006 à 09:42
joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007
-
9 mai 2006 à 15:34
je voudrai convertir une Date en String et l'inverse, la Date et de format (YY MM JJ HH : MM) mais je n'arrive pas a le faire
joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007 9 mai 2006 à 15:34
cbon j'ai trouver le probleme en faite il faut changer
ParseException par
Exception
try
{
Date d=stringToDate(maDate);
}
catch (Exception e)
{
e.printStackTrace();
}
est ca marche merci en tous cas
joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007 9 mai 2006 à 11:11
ok désole
ma question etais male formuler
enfaite j''ai ecrit ca :
public static String datetostring(Date sDate) throws Exception
{
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy hh:mm");
return sdf.format(sDate);
}
public static Date stringToDate(String sDate) throws Exception
{
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy hh:mm");
return sdf.parse(sDate);
}
mais quand je fait appel a ces deux methodes j'ai un message d'erreur type
"Type d'exception Exception non géré"
merci
joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007 9 mai 2006 à 11:31
voila mon appel a cette methede ce fait de cette façon:
try
{
Date d=stringToDate(maDate);
}
catch (DataFormatException e)
{
e.printStackTrace();
}
mais il ya toujours ce message d'erreur "Type d'exception Exception non géré"
merci
joeblack198
Messages postés13Date d'inscriptionlundi 6 février 2006StatutMembreDernière intervention11 avril 2007 9 mai 2006 à 15:04
je l'ai changer voil le resultat
try
{
Date d=stringToDate(maDate);
}
catch (ParseException e)
{
e.printStackTrace();
}
il ya toujours ce message d'erreur "Type d'exception Exception non géré"
est désoler de t'avoir deranger