Simple conversion between java.util.Date and XMLGregorianCalendar

后端 未结 7 1170
夕颜
夕颜 2020-12-02 04:25

I\'m looking for a simple method of converting between java.util.Date and javax.xml.datatype.XMLGregorianCalendar in both directions.

Here is the code that

相关标签:
7条回答
  • 2020-12-02 05:28

    From XMLGregorianCalendar to java.util.Date you can simply do:

    java.util.Date dt = xmlGregorianCalendarInstance.toGregorianCalendar().getTime();  
    
    0 讨论(0)
提交回复
热议问题