Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.GregorianCalendar;

import javax.xml.datatype.XMLGregorianCalendar;

public class Main {
    /**
     * Convert date from XML GregorianCalendar to String in 'MM/dd/yyyy hh:mm:ss'
     * 
     * @param xmlCalendar
     * @return String
     */
    public static String XMLGregorianCalendartoString(XMLGregorianCalendar xmlCalendar) {
        GregorianCalendar calendar = xmlCalendar.toGregorianCalendar();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        return simpleDateFormat.format(calendar.getTime());
    }
}