Java tutorial
//package com.java2s; /******************************************************************************* * Copyright SemanticBits, Northwestern University and Akaza Research * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caaers/LICENSE.txt for details. ******************************************************************************/ import java.sql.Timestamp; import javax.xml.datatype.XMLGregorianCalendar; public class Main { public static Timestamp toTimestamp(XMLGregorianCalendar xmlDate) { if (xmlDate == null) return null; return new Timestamp(xmlDate.toGregorianCalendar().getTime().getTime()); } }