I'm trying to parse the date returned as a value from the HTML5 datetime
input field. Try it in Opera to see an example. The date returned looks like this: 2011-05-03T11:58:01Z
.
I'd like to parse that into a Java Date or Calendar Object.
Ideally a solution should have the following things:
С форматом у вас есть, например. 2011-05-03T11: 58: 01Z, ниже код подойдет. Тем не менее, я недавно пробовал html5 datetime в Chrome и Opera, и это дает мне 2011-05-03T11: 58Z -> нет части ss, которая не может быть обработана с помощью кода ниже.
new Timestamp(javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(date).toGregorianCalendar().getTimeInMillis());