Concaténer date et heure en Java date
Bonjour,
j'ai deux variables de type Time et Date et je veux en faire une concaténation pour avoir un affichage 'date,heure'. Ci-dessous ma classe :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
public class date {
public static void main(String[] args) throws SQLException
{
final SimpleDateFormat dateHeureFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
connexionBD con = new connexionBD();
ResultSet rs = con.execute("select heure,ftp,date from ftptable; ");
final TimeSeries series = new TimeSeries("Flybox", Minute.class);
while(rs.next()){
java.util.Date v1;
v1 = rs.getTime("heure");
Date v3 = rs.getDate("date");
SimpleDateFormat date1 = new SimpleDateFormat(v3,v1);
String dateStr = SimpleDateFormat.format(date1);
System.out.println("la date est",+dateStr+);
double v2=rs.getFloat("ftp");
System.out.println(v1);
}
}
} |
Mais ca ne fonctionne pas ><