Now I am writing a server, and I would like to check the "If-Modified-Since:" header.
Since there are so many date methods, which methods should be considered, for example, as a regular method (milliseconds are used in browsers) ....
Follwing has a format for milliseconds.
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);
I also want to check the format "Wed, 19 Oct 2005 10:50:00 GMT". How can I change this date in milliseconds?
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 with the listening above and please tell me if there is a date format that I should check.
Ken
source share