Bonjour,
j'ai un petit problème de conversion d'une date de "TimeStamp" vers "Date".
j'ai l'erreur suivante:
Exception :java.text.ParseException: Unparseable date: "1140678326134"
voici mon code:
---------------
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public static void main(String[] args) {
 
 try {    
     String exp_date="1140678326134";
 
          DateFormat formatter ; 
          Date date ; 
 
          formatter = new SimpleDateFormat("dd-MM-yyyy");
          date = (Date)formatter.parse(exp_date); 
          java.sql.Timestamp timeStampDate = new Timestamp(date.getTime());
 
          System.out.println("Date: " +timeStampDate);
    } 
 
 catch (ParseException e)
    {System.out.println("Exception :"+e);    }    
 
   }