AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ottenere una data

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
Gianni Pinolo
Guest





PostPosted: Mon Jun 28, 2004 4:51 pm    Post subject: Ottenere una data Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.