Java XML Date to toTimestamp(XMLGregorianCalendar xmlDate)

Here you can find the source of toTimestamp(XMLGregorianCalendar xmlDate)

Description

to Timestamp

License

BSD License

Declaration

public static Timestamp toTimestamp(XMLGregorianCalendar xmlDate) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright SemanticBits, Northwestern University and Akaza Research
 * /*  w w w.j ava  2 s  . c  o  m*/
 * 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());
    }
}

Related

  1. getLocalTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal)
  2. getMilliseconds(XMLGregorianCalendar xmlCalendar)
  3. getNextMonthDate(GregorianCalendar calendar)
  4. toTimestamp(XMLGregorianCalendar calendar)
  5. toTimestamp(XMLGregorianCalendar xgc)