Here you can find the source of getXMLDate(Element e, String attrName)
public static Date getXMLDate(Element e, String attrName)
//package com.java2s; // modify it under the terms of the GNU General Public License import java.util.Date; import org.w3c.dom.Element; public class Main { public static Date getXMLDate(Element e, String attrName) { String s = e.getAttribute(attrName); if (s == null || s.length() == 0) return null; try {//from ww w .j a va 2s . c om return parseDate(s); } catch (Exception exc) { return null; } } private static Date parseDate(String d) throws IllegalArgumentException { if (!d.startsWith("@")) throw new IllegalArgumentException(); return new Date(Long.parseLong(d.substring(1))); } }