Ora sto scrivendo un server e vorrei verificare l'intestazione "If-Modified-Since:".
Poiché ci sono tanti metodi di data, quali metodi dovrei prendere in considerazione per verificare, come un metodo usuale (millisecondi è utilizzato nei browser) ....Se modificato - Dal formato data
follwing è howi ha fatto per il formato millisecondi.
Date date;
//dateS is a substring of If-Modified-Since: header
try{
long mills = Long.parseLong(dateS);
} catch (NumberFormatException e)
{e.printStackTrace();
}
date = new Date(mills);
Desidero anche controllare il formato "Mer, 19 Ott 2005 10:50:00 GMT". Come posso cambiare quella data in millisecondi ??
SimpleDateFormat dateFormat = new SimpleDateFormat(
"EEE, dd MMM yyyy HH:mm:ss z");
// to check if-modified-since time is in the above format
try {
ifModifiedSince = dateFormat.parse(date);
?????????????????????
} catch (ParseException e1) {
}
Please help me con chaging quanto sopra e la prego di dirmi se c'è qualche formato di data che dovrei controllare ..
già risposto credo: [http://stackoverflow.com/questions/1930158/how-to-parse-date-from-http-last-modified-header][1] [1]: http://stackoverflow.com/questions/1930158/how-to-parse-date-from-http-last-modified-header – Farid
i browser utilizzano millisecondo come Data ultima modifica, perché è quello che ho state ricevendo nell'intestazione della richiesta in tutti i browser – Ken
nel collegamento mi riferivo ad usare format.parse (dateString) .getTime(); – Farid