Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
cilovie
Pourtant c'est indiqué : http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" a écrit dans le message de news:40e5a263$0$306$
Bonjour
Le code : try { String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy"); Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad )); Date t = form.parse(ladate ); // ne fonctionne pas
} catch(Exception fe ) { System.out.println(fe.getMessage()); }
Le system.out :
Je calcule la date "-juin-04 Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou Americaine, et je souhaite la parser en Date. Comment faire ??
Merci.
Pourtant c'est indiqué :
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern)
Constructs a SimpleDateFormat using the given pattern and the
default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale)
Constructs a SimpleDateFormat using the given pattern and the
default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" <terencio@club-internet.fr> a écrit dans le message de
news:40e5a263$0$306$7a628cd7@news.club-internet.fr...
Bonjour
Le code :
try {
String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy");
Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad ));
Date t = form.parse(ladate ); // ne fonctionne pas
}
catch(Exception fe )
{
System.out.println(fe.getMessage());
}
Le system.out :
Je calcule la date "-juin-04
Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou
Americaine, et je souhaite la parser en Date.
Comment faire ??
Pourtant c'est indiqué : http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" a écrit dans le message de news:40e5a263$0$306$
Bonjour
Le code : try { String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy"); Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad )); Date t = form.parse(ladate ); // ne fonctionne pas
} catch(Exception fe ) { System.out.println(fe.getMessage()); }
Le system.out :
Je calcule la date "-juin-04 Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou Americaine, et je souhaite la parser en Date. Comment faire ??
Merci.
T007
cilovie wrote:
Pourtant c'est indiqué : http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" a écrit dans le message de news:40e5a263$0$306$
Bonjour
Le code : try { String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy"); Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad )); Date t = form.parse(ladate ); // ne fonctionne pas
} catch(Exception fe ) { System.out.println(fe.getMessage()); }
Le system.out :
Je calcule la date "-juin-04 Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou Americaine, et je souhaite la parser en Date. Comment faire ??
Merci.
j'avais pas vu ce constructeur..
Merci
cilovie wrote:
Pourtant c'est indiqué :
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern)
Constructs a SimpleDateFormat using the given pattern and the
default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale)
Constructs a SimpleDateFormat using the given pattern and the
default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" <terencio@club-internet.fr> a écrit dans le message de
news:40e5a263$0$306$7a628cd7@news.club-internet.fr...
Bonjour
Le code :
try {
String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy");
Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad ));
Date t = form.parse(ladate ); // ne fonctionne pas
}
catch(Exception fe )
{
System.out.println(fe.getMessage());
}
Le system.out :
Je calcule la date "-juin-04
Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou
Americaine, et je souhaite la parser en Date.
Comment faire ??
Pourtant c'est indiqué : http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat(String pattern) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the default locale.
SimpleDateFormat(String pattern, Locale locale) Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the given locale.
Donc utilise Locale.UK ou Locale.US
"T007" a écrit dans le message de news:40e5a263$0$306$
Bonjour
Le code : try { String ladate="22-Jun-04";
SimpleDateFormat form2 = new SimpleDateFormat("dd/MM/yy"); Date mad = form2.parse("22/06/04");
SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
System.out.println("Je calcule la date =" + form.format(mad )); Date t = form.parse(ladate ); // ne fonctionne pas
} catch(Exception fe ) { System.out.println(fe.getMessage()); }
Le system.out :
Je calcule la date "-juin-04 Unparseable date: "22-Jun-04"
Mon probleme est simple , j'ai une String avec une date anglaise ou Americaine, et je souhaite la parser en Date. Comment faire ??