Java et timestamp
geoffreybulle
-
Utilisateur anonyme -
Utilisateur anonyme -
bonjour,
j'ai un petit problème. Je récupère d'un fichier access.log un timestamp da la forme 1175254023.455. Je voudrais le convertir en format date et heure da la forme 20070330 09:00:00. avec java
Comment faire ?
j'ai un petit problème. Je récupère d'un fichier access.log un timestamp da la forme 1175254023.455. Je voudrais le convertir en format date et heure da la forme 20070330 09:00:00. avec java
Comment faire ?
Configuration: Linux Debian Firefox 1.5.0.7
A voir également:
- Java et timestamp
- Jeux java itel - Télécharger - Jeux vidéo
- Waptrick java football - Télécharger - Jeux vidéo
- Java apk - Télécharger - Langages
- Jeux java itel touche ✓ - Forum Logiciels
- Jeux java itel 5360 - Forum Mobile
1 réponse
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created on 07-avr.-07
*
* @author: HackTrack
*/
public class DateFormatter {
public static void main(String[] args) {
double timeMillis = 1175254023.455;
Date d = new Date((long)timeMillis);
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
System.out.println(formatter.format(d));
}
}
;-)
HackTrack