 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gianni Pinolo Guest
|
Posted: Mon Jun 28, 2004 4:51 pm Post subject: Ottenere una data |
|
|
Buonasera a tutti.
Ho passato questa giornata nel tentativo di risolvere questo problema:
ho una data formattata nella seguente maniera :
Fri, 23 Apr 2004 08:38:20 +0200
vorrei convertirla a modo mio.
Il problema è che non riesco a ottenere un oggetto Date a partire dalla
data datami (scusate il gioco di parole).
Eccovi un pò di codice per dimostrarvi che un pò di impegno ce l'ho
messo, e non sto qui solo per far perdere tempo a qualcun altro:
DateFormat dT = DateFormat.getDateInstance();
//la riga seguente và in eccezione, non gli piace il formato
Date date = date = dT.parse("Fri, 23 Apr 2004 08:38:20 +0200");
Ho fatto diverse prove, tutte fallite; un altro esempio:
SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
Date date = new Date("Fri, 23 Apr 2004 08:38:20 +0200");
//Ottengo una data sfalsata di 11 ore prima
String myFormat = formatDate.parse(date);
"Data" la situazione capirete bene che ogni suggerimento è gradito
Grazie & Ciao
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|