Java XML Date extractXsdDatetime(String string)

Here you can find the source of extractXsdDatetime(String string)

Description

Extracts the timestamp of a XsdDateTime string.

License

Open Source License

Parameter

Parameter Description
string A XsdDatetime represented as a java.lang.String .

Return

A timestamp.

Declaration

public static long extractXsdDatetime(String string) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU Lesser General Public License as published by

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**/*from   w w  w .  j av  a2s.  c  om*/
     * Extracts the timestamp of a XsdDateTime string.
     * @param string A XsdDatetime represented as a {@link java.lang.String}.
     * @return A timestamp.
     */
    public static long extractXsdDatetime(String string) {
        return DatatypeConverter.parseDateTime(string).getTimeInMillis();
    }
}

Related

  1. convertDate(String date)
  2. dateToDouble(Object value)
  3. dateToString(Date date)
  4. dateToString(Date date)
  5. dateToXsdDateTime(Date date)
  6. formatXmlDate(Calendar cal)
  7. getDateTimeRepresentation(Calendar date)
  8. getDateTimeString(Date dateTime)
  9. getXMLDate(final Date date)