Java tutorial
//package com.java2s; //License from project: LGPL import java.util.GregorianCalendar; import java.util.TimeZone; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; public class Main { public static GregorianCalendar fromXSDateTime(String dateTime) throws DatatypeConfigurationException { GregorianCalendar cal = null; if (dateTime != null && dateTime.length() != 0) { cal = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateTime).toGregorianCalendar(); cal.setTimeZone(TimeZone.getTimeZone("UTC")); } return cal; } }